Debian Codegraph @

translations/manual/zh_CN/regexp_quick_reference.po

raw
1 # SOME DESCRIPTIVE TITLE.
2 # Copyright (C) Kovid Goyal
3 # This file is distributed under the same license as the calibre package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 # Translators:
7 # Hoilc <[email protected]>, 2018
8 # Andrew Chen <[email protected]>, 2018
9 # Junle Wang, 2022
10 # Dingyuan Wang <[email protected]>, 2026
11 # tony shen <[email protected]>, 2026
12 # Pengcheng Guo <[email protected]>, 2026
13 # RERBIN MA, 2026
14 #
15 #, fuzzy
16 msgid ""
17 msgstr ""
18 "Project-Id-Version: calibre 9.3.1\n"
19 "Report-Msgid-Bugs-To: \n"
20 "POT-Creation-Date: 2026-02-25 10:21+0000\n"
21 "PO-Revision-Date: 2017-12-15 03:02+0000\n"
22 "Last-Translator: RERBIN MA, 2026\n"
23 "Language-Team: Chinese (China) (https://app.transifex.com/calibre/teams/19337/zh_CN/)\n"
24 "MIME-Version: 1.0\n"
25 "Content-Type: text/plain; charset=UTF-8\n"
26 "Content-Transfer-Encoding: 8bit\n"
27 "Language: zh_CN\n"
28 "Plural-Forms: nplurals=1; plural=0;\n"
29
30 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:2
31 msgid "Quick reference for regexp syntax"
32 msgstr "正则表达式语法速查"
33
34 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:4
35 msgid ""
36 "This checklist summarizes the most commonly used/hard to remember parts of "
37 "the regexp engine available in most parts of calibre."
38 msgstr "这份清单总结了最常用/最难记住的正则表达式引擎部件,这些部件可在Calibre的大多数部件中使用。"
39
40 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:10
41 msgid "Contents"
42 msgstr "目录"
43
44 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:13
45 msgid "Character classes"
46 msgstr "字符种类"
47
48 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:15
49 msgid ""
50 "Character classes are useful to represent different groups of characters, "
51 "succinctly."
52 msgstr "字符集合可以用来简洁地表示不同的字符组合。"
53
54 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:18
55 msgid "Examples:"
56 msgstr "例如:"
57
58 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:21
59 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:52
60 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:241
61 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:271
62 msgid "**Representation**"
63 msgstr "**表达式**"
64
65 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:21
66 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:52
67 msgid "**Class**"
68 msgstr "**种类**"
69
70 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:24
71 msgid "``[a-z]``"
72 msgstr "``[a-z]``"
73
74 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:24
75 msgid ""
76 "Lowercase letters. Does not include characters with accent mark and "
77 "ligatures"
78 msgstr "小写字母,不包括带重音符号的字母和连字字母"
79
80 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:27
81 msgid "``[a-z0-9]``"
82 msgstr "``[a-z0-9]``"
83
84 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:27
85 msgid "Lowercase letters from a to z or numbers from 0 to 9"
86 msgstr "a 到 z 的小写字母或 0 到 9 的数字"
87
88 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:29
89 msgid "``[A-Za-z-]``"
90 msgstr "``[A-Za-z-]``"
91
92 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:29
93 msgid ""
94 "Uppercase or lowercase letters, or a dash. To include the dash in a class, "
95 "you must put it at the beginning or at the end so as not to confuse it with "
96 "the hyphen that specifies a range of characters"
97 msgstr "大写和小写字母,或短横“-”。要在集合中包括短横,必须把它放在开头或结尾,从而不会和指定字符范围的短横混淆。"
98
99 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:33
100 msgid "``[^0-9]``"
101 msgstr "``[^0-9]``"
102
103 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:33
104 msgid ""
105 "Any character except a digit. The caret (^) placed at the beginning of the "
106 "class excludes the characters of the class (complemented class)"
107 msgstr "除数字之外的任何字符。 位于类开头的插入符号 (^) 排除该类的字符(补集类)"
108
109 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:36
110 msgid "``[[a-z]--[aeiouy]]``"
111 msgstr "``[[a-z]--[aeiouy]]``"
112
113 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:36
114 msgid ""
115 "The lowercase consonants. A class can be included in a class. The characters"
116 " ``--`` exclude what follows them"
117 msgstr "小写元音字母。字符集合可以包含另一个字符集合。``--`` 符号表示排除它之后的集合"
118
119 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:39
120 msgid "``[\\w--[\\d_]]``"
121 msgstr "``[\\w--[\\d_]]``"
122
123 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:39
124 msgid ""
125 "All letters (including foreign accented characters). Abbreviated classes can"
126 " be used inside a class"
127 msgstr "所有字母(包括带重音符号的外语字母)。 可以在类内部使用缩写类"
128
129 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:44
130 msgid "Example::"
131 msgstr "例如:"
132
133 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:49
134 msgid "Shorthand character classes"
135 msgstr "缩写字符集合"
136
137 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:55
138 msgid "``\\d``"
139 msgstr "``\\d``"
140
141 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:55
142 msgid "A digit (same as ``[0-9]``)"
143 msgstr "一个数字( 与``[0-9]``相同)"
144
145 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:57
146 msgid "``\\D``"
147 msgstr "``\\D``"
148
149 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:57
150 msgid "Any non-numeric character (same as ``[^0-9]``)"
151 msgstr "任何非数字字符(与 ``[^0-9]``相同)"
152
153 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:59
154 msgid "``\\w``"
155 msgstr "``\\w``"
156
157 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:59
158 msgid ""
159 "An alphanumeric character (``[a-zA-Z0-9]``) including characters with accent"
160 " mark and ligatures"
161 msgstr "一种字母数字字符(``[a-zA-Z0-9]```),包括带重音符号和连字的字符"
162
163 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:62
164 msgid "``\\W``"
165 msgstr "``\\W``"
166
167 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:62
168 msgid "Any “non-word” character"
169 msgstr "任何“非单词”字符"
170
171 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:64
172 msgid "``\\s``"
173 msgstr "``\\s``"
174
175 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:64
176 msgid "Space, non-breaking space, tab, carriage return"
177 msgstr "空格、不换行空格、制表符、回车符"
178
179 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:66
180 msgid "``\\S``"
181 msgstr "``\\S``"
182
183 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:66
184 msgid "Any “non-whitespace” character"
185 msgstr "任何“非空白”字符"
186
187 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:68
188 msgid "``.``"
189 msgstr "``.``"
190
191 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:68
192 msgid ""
193 "Any character except newline. Use the “dot all” checkbox or the ``(?s)`` "
194 "regexp modifier to include the newline character."
195 msgstr "除换行符以外的任何字符。使用“.all”复选框或``(?s)``正则表达式修饰符来包含换行符。"
196
197 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:73
198 msgid "The quantifiers"
199 msgstr "量词"
200
201 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:76
202 msgid "**Quantifier**"
203 msgstr "**量词**"
204
205 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:76
206 msgid "**Number of occurrences of the expression preceding the quantifier**"
207 msgstr "**量词前表达式出现次数**"
208
209 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:79
210 msgid "``?``"
211 msgstr "``?``"
212
213 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:79
214 msgid "0 or 1 occurrence of the expression. Same as ``{0,1}``"
215 msgstr "表达式出现0或1次。与``{0,1}``相同"
216
217 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:81
218 msgid "``+``"
219 msgstr "``+``"
220
221 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:81
222 msgid "1 or more occurrences of the expression. Same as ``{1,}``"
223 msgstr "表达式出现1次或多次。与``{1,}``相同"
224
225 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:83
226 msgid "``*``"
227 msgstr "``*``"
228
229 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:83
230 msgid "0, 1 or more occurrences of the expression. Same as ``{0,}``"
231 msgstr "表达式出现0次、1次或更多次。与``{0,}``相同"
232
233 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:85
234 msgid "``{n}``"
235 msgstr "``{n}``"
236
237 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:85
238 msgid "Exactly n occurrences of the expression"
239 msgstr "该表达式恰好出现n次"
240
241 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:87
242 msgid "``{min,max}``"
243 msgstr "``{min,max}``"
244
245 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:87
246 msgid "Number of occurrences between the minimum and maximum values included"
247 msgstr "包含的最小值和最大值之间的出现次数"
248
249 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:89
250 msgid "``{min,}``"
251 msgstr "``{min,}``"
252
253 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:89
254 msgid "Number of occurrences between the minimum value included and infinity"
255 msgstr "出现次数介于包含最小值到无穷大之间"
256
257 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:91
258 msgid "``{,max}``"
259 msgstr "``{,max}``"
260
261 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:91
262 msgid "Number of occurrences between 0 and the maximum value included"
263 msgstr "介于0和包含的最大值之间的出现次数"
264
265 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:97
266 msgid "Greed"
267 msgstr "贪婪"
268
269 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:99
270 msgid ""
271 "By default, with quantifiers, the regular expression engine is greedy: it "
272 "extends the selection as much as possible. This often causes surprises, at "
273 "first. ``?`` follows a quantifier to make it lazy. Avoid putting two in the "
274 "same expression, the result can be unpredictable."
275 msgstr ""
276 "默认情况下,对于量词,正则表达式引擎是贪婪的:它尽可能多地扩展选择。起初,这往往会引起意外。“?”跟随一个量词使其变懒。避免将两者放在同一个表达式中,结果可能是不可预测的。"
277
278 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:104
279 msgid ""
280 "Beware of nesting quantifiers, for example, the pattern ``(a*)*``, as it "
281 "exponentially increases processing time."
282 msgstr "小心嵌套的量词,例如模式“(a*)*”,因为它会成倍地增加处理时间。"
283
284 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:108
285 msgid "Alternation"
286 msgstr "交替"
287
288 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:110
289 msgid ""
290 "The ``|`` character in a regular expression is a logical ``OR``. It means "
291 "that either the preceding or the following expression can match."
292 msgstr "正则表达式中的“|”字符是逻辑“OR”。这意味着前面的表达式或下面的表达式都可以匹配。"
293
294 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:114
295 msgid "Exclusion"
296 msgstr "不包括在内"
297
298 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:116
299 msgid "Method 1"
300 msgstr "方法 1"
301
302 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:118
303 msgid "``pattern_to_exclude(*SKIP)(*FAIL)|pattern_to_select``"
304 msgstr "``pattern_to_exclude(*SKIP)(*FAIL)|pattern_to_select``"
305
306 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:120
307 msgid "Example:"
308 msgstr "例如:"
309
310 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:122
311 msgid "``\"Blabla\"(*SKIP)(*FAIL)|Blabla``"
312 msgstr "``\"Blabla\"(*SKIP)(*FAIL)|Blabla``"
313
314 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:124
315 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:132
316 msgid ""
317 "selects Blabla, in the strings Blabla or \"Blabla or Blabla\", but not in "
318 "\"Blabla\"."
319 msgstr "选择Blabla,在字符串Blabla或“Blabla or Blabla”中,但不在“Blabla”中。"
320
321 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:126
322 msgid "Method 2"
323 msgstr "方法 2"
324
325 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:128
326 msgid "``pattern_to_exclude\\K|(pattern_to_select)``"
327 msgstr "``pattern_to_exclude\\K|(pattern_to_select)``"
328
329 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:130
330 msgid "``\"Blabla\"\\K|(Blabla)``"
331 msgstr "``\"Blabla\"\\K|(Blabla)``"
332
333 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:135
334 msgid "Anchors"
335 msgstr "锚"
336
337 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:137
338 msgid ""
339 "An anchor is a way to match a logical location in a string, rather than a "
340 "character. The most useful anchors for text processing are:"
341 msgstr "锚点是匹配字符串中的逻辑位置而不是字符的一种方式。文本处理中最有用的锚点是:"
342
343 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:140
344 msgid "``\\b``"
345 msgstr "``\\b``"
346
347 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:141
348 msgid ""
349 "Designates a word boundary, i.e. a transition from space to non-space "
350 "character. For example, you can use ``\\bsurd`` to match ``the surd`` but "
351 "not ``absurd``."
352 msgstr "指定单词边界,即从空格字符到非空格字符的转换。例如,您可以使用“\\bssurd”来匹配“the surd”,但不能使用“荒谬”。"
353
354 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:145
355 msgid "``^``"
356 msgstr "``^``"
357
358 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:146
359 msgid "Matches the start of a line (in multi-line mode, which is the default)"
360 msgstr "匹配行首(在多行模式下,这是默认设置)"
361
362 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:149
363 msgid "``$``"
364 msgstr "``$``"
365
366 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:150
367 msgid "Matches the end of a line (in multi-line mode, which is the default)"
368 msgstr "匹配行尾(在多行模式下,这是默认设置)"
369
370 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:152
371 msgid "``\\K``"
372 msgstr "``\\K``"
373
374 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:153
375 msgid ""
376 "Resets the start position of the selection to its position in the pattern. "
377 "Some regexp engines (but not calibre) do not allow lookbehind of variable "
378 "length, especially with quantifiers. When you can use ``\\K`` with these "
379 "engines, it also allows you to get rid of this limit by writing the "
380 "equivalent of a positive lookbehind of variable length."
381 msgstr ""
382 "将所选内容的起始位置重置为其在阵列中的位置。一些正则表达式引擎(但不是calibre)不允许可变长度的lookbacking,尤其是使用量词。当您可以将“\\K”与这些引擎一起使用时,它还允许您通过编写可变长度的正查找表来消除这一限制。"
383
384 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:160
385 msgid "Groups"
386 msgstr "组"
387
388 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:162
389 msgid "``(expression)``"
390 msgstr "``(表达式)``"
391
392 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:163
393 msgid ""
394 "Capturing group, which stores the selection and can be recalled later in the"
395 " *search* or *replace* patterns with ``\\n``, where ``n`` is the sequence "
396 "number of the capturing group (starting at 1 in reading order)"
397 msgstr "捕获组,它存储所选内容,并可稍后在*搜索*或*替换*模式中用“\\n”调用,其中“n”是捕获组的序列号(按读取顺序从1开始)"
398
399 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:167
400 msgid "``(?:expression)``"
401 msgstr "``(?:表达式)``"
402
403 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:168
404 msgid "Group that does not capture the selection"
405 msgstr "未捕获所选内容的组"
406
407 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:170
408 msgid "``(?>expression)``"
409 msgstr "``(?>表达式)``"
410
411 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:171
412 msgid ""
413 "Atomic Group: As soon as the expression is satisfied, the regexp engine "
414 "passes, and if the rest of the pattern fails, it will not backtrack to try "
415 "other combinations with the expression. Atomic groups do not capture."
416 msgstr ""
417 "Atomic Group:一旦满足表达式,正则表达式引擎就会通过,如果模式的其余部分失败,它将不会回溯以尝试与表达式的其他组合。原子组不会捕获。"
418
419 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:176
420 msgid "``(?|expression)``"
421 msgstr "``(?|表达式)``"
422
423 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:177
424 msgid ""
425 "Branch reset group: the branches of the alternations included in the "
426 "expression share the same group numbers"
427 msgstr "分支重置组:表达式中包含的替换项的分支共享相同的组号"
428
429 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:180
430 msgid "``(?<name>expression)``"
431 msgstr "``(?<name>表达式)``"
432
433 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:181
434 msgid ""
435 "Group named “name”. The selection can be recalled later in the *search* "
436 "pattern by ``(?P=name)`` and in the *replace* by ``\\g<name>``. Two "
437 "different groups can use the same name."
438 msgstr ""
439 "名为“name”的组。稍后可以在*search*模式中用“(?P=name)”和在*replace*中用“\\g "
440 "<name>”调用所选内容。两个不同的组可以使用相同的名称。"
441
442 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:187
443 msgid "Lookarounds"
444 msgstr "Lookarounds"
445
446 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:190
447 msgid "**Lookaround**"
448 msgstr "**Lookaround**"
449
450 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:190
451 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:241
452 msgid "**Meaning**"
453 msgstr "**Meaning**"
454
455 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:193
456 msgid "``?=``"
457 msgstr "``?=``"
458
459 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:193
460 msgid "Positive lookahead (to be placed after the selection)"
461 msgstr "正向前视(放置在选定内容之后)"
462
463 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:196
464 msgid "``?!``"
465 msgstr "``?!``"
466
467 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:196
468 msgid "Negative lookahead (to be placed after the selection)"
469 msgstr "反向前视(放在选择之后)"
470
471 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:199
472 msgid "``?<=``"
473 msgstr "``?<=``"
474
475 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:199
476 msgid "Positive lookbehind (to be placed before the selection)"
477 msgstr "正向后视(放在所选内容之前)"
478
479 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:202
480 msgid "``?<!``"
481 msgstr "``?<!``"
482
483 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:202
484 msgid "Negative lookbehind (to be placed before the selection)"
485 msgstr "反向后视(放在选定内容之前)"
486
487 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:206
488 msgid ""
489 "Lookaheads and lookbehinds do not consume characters, they are zero length "
490 "and do not capture. They are atomic groups: as soon as the assertion is "
491 "satisfied, the regexp engine passes, and if the rest of the pattern fails, "
492 "it will not backtrack inside the lookaround to try other combinations."
493 msgstr ""
494 "Lookahead和lookbehinds不消耗字符,它们为零长度,不捕获。它们是原子组:只要断言得到满足,正则表达式引擎就会通过,如果模式的其余部分失败,它就不会在环视中回溯以尝试其他组合。"
495
496 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:211
497 msgid ""
498 "When looking for multiple matches in a string, at the starting position of "
499 "each match attempt, a lookbehind can inspect the characters before the "
500 "current position. Therefore, on the string 123, the pattern ``(?<=\\d)\\d`` "
501 "(a digit preceded by a digit) should, in theory, select 2 and 3. On the "
502 "other hand, ``\\d\\K\\d`` can only select 2, because the starting position "
503 "after the first selection is immediately before 3, and there are not enough "
504 "digits for a second match. Similarly, ``\\d(\\d)`` only captures 2. In "
505 "calibre's regexp engine practice, the positive lookbehind behaves in the "
506 "same way, and selects only 2, contrary to theory."
507 msgstr ""
508 "在字符串中查找多个匹配时,在每次匹配尝试的起始位置,后行断言可以检查当前位置之前的字符。因此,在字符串123上,模式“(?<=\\d)\\d”(一个数字前面有一个数字)理论上应该选择2和3。另一方面,“\\d\\K\\d”只能选择2,因为第一次选择后的起始位置正好在3之前,并且没有足够的数字进行第二次匹配。类似地,“\\d(\\d)”只捕获2。在calibre的regexp引擎实践中,正向后行断言的行为与理论相反,只选择2。"
509
510 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:221
511 msgid ""
512 "Groups can be placed inside lookarounds, but capture is rarely useful. "
513 "Nevertheless, if it is useful, it will be necessary to be very careful in "
514 "the use of a quantifier in a lookbehind: the greed associated with the "
515 "absence of backtracking can give a surprising capture. For this reason, use "
516 "``\\K`` rather than a positive lookbehind when you have a quantifier (or "
517 "worse, several) in a capturing group of the positive lookbehind."
518 msgstr ""
519 "组可以放置在环视区内,但捕获很少有用。然而,如果它是有用的,那么在后行断言中使用量词时就必须非常小心:与没有后行断言相关的贪婪可能会带来令人惊讶的结果。出于这个原因,当你在一个正向后行断言的捕获组中有一个量词(或者更糟的是,几个)时,使用“\\K”而不是正向后行断言。"
520
521 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:228
522 msgid "Example of negative lookahead:"
523 msgstr "负向先行断言示例:"
524
525 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:230
526 msgid "``(?![^<>{}]*[>}])``"
527 msgstr "``(?![^<>{}]*[>}])``"
528
529 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:232
530 msgid ""
531 "Placed at the end of the pattern prevents selecting within a tag or a style "
532 "embedded in the file."
533 msgstr "将其放置在规则末尾,可防止选中标签内部或文件中嵌入的样式。"
534
535 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:234
536 msgid ""
537 "Whenever possible, it is always better to \"anchor\" the lookarounds, to "
538 "reduce the number of steps necessary to obtain the result."
539 msgstr "只要可能,最好“固定”环视,以减少获得结果所需的步骤数。"
540
541 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:238
542 msgid "Recursion"
543 msgstr "Recursion"
544
545 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:244
546 msgid "``(?R)``"
547 msgstr "``(?R)``"
548
549 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:244
550 msgid "Recursion of the entire pattern"
551 msgstr "递归匹配整个模式"
552
553 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:247
554 msgid "``(?1)``"
555 msgstr "``(?1)``"
556
557 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:247
558 msgid ""
559 "Recursion of the only pattern of the numbered capturing group, here group 1"
560 msgstr "编号捕获组的唯一模式的递归,此处为组1"
561
562 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:251
563 msgid ""
564 "Recursion is calling oneself. This is useful for balanced queries, such as "
565 "quoted strings, which can contain embedded quoted strings. Thus, if during "
566 "the processing of a string between double quotation marks, we encounter the "
567 "beginning of a new string between double quotation marks, well we know how "
568 "to do, and we call ourselves. Then we have a pattern like::"
569 msgstr ""
570 "递归是在召唤自己。这对于平衡查询非常有用,例如可以包含嵌入的带引号的字符串的引号字符串。因此,如果在处理双引号之间的字符串的过程中,我们遇到双引号之间的新字符串的开头,那么我们知道如何做,我们称之为自己。然后我们就有了类似这样的模式:"
571
572 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:259
573 msgid ""
574 "To select a string between double quotation marks without stopping on an "
575 "embedded string::"
576 msgstr "要在双引号之间选择字符串而不在嵌入的字符串上停止,请执行以下操作:"
577
578 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:263
579 msgid ""
580 "This template can also be used to modify pairs of tags that can be embedded,"
581 " such as ``<div>`` tags."
582 msgstr "该模板还可用于修改可嵌入的标签对,例如“<div>”标签。"
583
584 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:268
585 msgid "Special characters"
586 msgstr "特殊字符"
587
588 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:271
589 msgid "**Character**"
590 msgstr "**字符**"
591
592 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:274
593 msgid "``\\t``"
594 msgstr "``\\t``"
595
596 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:274
597 msgid "tabulation"
598 msgstr "tabulation"
599
600 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:277
601 msgid "``\\n``"
602 msgstr "``\\n``"
603
604 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:277
605 msgid "line break"
606 msgstr "换行符"
607
608 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:280
609 msgid "``\\x20``"
610 msgstr "``\\x20``"
611
612 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:280
613 msgid "(breakable) space"
614 msgstr "(可间断的)空格"
615
616 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:283
617 msgid "``\\xa0``"
618 msgstr "``\\xa0``"
619
620 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:283
621 msgid "no-break space"
622 msgstr "不间断空格"
623
624 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:288
625 msgid "Meta-characters"
626 msgstr "元字符"
627
628 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:290
629 msgid ""
630 "Meta-characters are those that have a special meaning for the regexp engine."
631 " Of these, twelve must be preceded by an escape character, the backslash "
632 "(``\\``), to lose their special meaning and become a regular character "
633 "again::"
634 msgstr ""
635 "元字符是那些对正则表达式引擎具有特殊意义的字符。其中,十二必须在前加一个转义符,即反斜杠(``\\``),才能失去其特殊含义,重新成为正则字符:"
636
637 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:296
638 msgid ""
639 "Seven other meta-characters do not need to be preceded by a backslash (but "
640 "can be without any other consequence)::"
641 msgstr "其他七个元字符不需要以反斜杠开头(但可以没有任何其他后果):"
642
643 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:302
644 msgid ""
645 "Special characters lose their status if they are used inside a class "
646 "(between brackets ``[]``). The closing bracket and the dash have a special "
647 "status in a class. Outside the class, the dash is a simple literal, the "
648 "closing bracket remains a meta-character."
649 msgstr ""
650 "如果在类中使用特殊字符(位于括号``[]``之间),它们将失去状态。括号和短划线在类中具有特殊的地位。在类之外,短划线是一个简单的文字,右括号仍然是一个元字符。"
651
652 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:307
653 msgid ""
654 "The slash (/) and the number sign (or hash character) (#) are not meta-"
655 "characters, they don’t need to be escaped."
656 msgstr "斜杠(/)和数字符号(或哈希字符)(#)不是元字符,它们不需要转义。"
657
658 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:310
659 msgid ""
660 "In some tools, like regex101.com with the Python engine, double quotes have "
661 "the special status of separator, and must be escaped, or the options "
662 "changed. This is not the case in the editor of calibre."
663 msgstr ""
664 "在一些工具中,如带有Python引擎的regex101.com,双引号具有分隔符的特殊状态,必须转义,或者更改选项。优秀编辑的情况并非如此。"
665
666 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:315
667 msgid "Modes"
668 msgstr "Modes"
669
670 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:317
671 msgid "``(?s)``"
672 msgstr "``(?s)``"
673
674 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:318
675 msgid "Causes the dot (``.``) to match newline characters as well"
676 msgstr "使点 (``.``) 也匹配换行符"
677
678 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:320
679 msgid "``(?m)``"
680 msgstr "``(?m)``"
681
682 #: ../../../__w/calibre/calibre/manual/regexp_quick_reference.rst:321
683 msgid ""
684 "Makes the ``^`` and ``$`` anchors match the start and end of lines instead "
685 "of the start and end of the entire string."
686 msgstr "使“^”和“$”锚与行的开始和结束匹配,而不是与整个字符串的开始和结尾匹配。"