-
-
Notifications
You must be signed in to change notification settings - Fork 209
/
re.po
2944 lines (2507 loc) · 96.1 KB
/
re.po
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2022, Python Software Foundation
# This file is distributed under the same license as the Python package.
#
# Translators:
# Leo Wang <ascodeasice@gmail.com>, 2023
msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-07 03:11+0800\n"
"PO-Revision-Date: 2023-09-16 14:49+0800\n"
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
"Language: zh_TW\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 3.3.2\n"
#: ../../library/re.rst:2
msgid ":mod:`!re` --- Regular expression operations"
msgstr ":mod:`!re` --- 正規表示式 (regular expression) 操作"
#: ../../library/re.rst:10
msgid "**Source code:** :source:`Lib/re/`"
msgstr "**原始碼:**\\ :source:`Lib/re/`"
#: ../../library/re.rst:14
msgid ""
"This module provides regular expression matching operations similar to those "
"found in Perl."
msgstr "此模組提供類似於 Perl 中正規表示式的配對操作。"
#: ../../library/re.rst:17
msgid ""
"Both patterns and strings to be searched can be Unicode strings (:class:"
"`str`) as well as 8-bit strings (:class:`bytes`). However, Unicode strings "
"and 8-bit strings cannot be mixed: that is, you cannot match a Unicode "
"string with a bytes pattern or vice-versa; similarly, when asking for a "
"substitution, the replacement string must be of the same type as both the "
"pattern and the search string."
msgstr ""
"被搜尋的模式 (pattern) 與字串可以是 Unicode 字串 (:class:`str`),也可以是 8-"
"bit 字串 (:class:`bytes`)。然而,Unicode 字串和 8-bit 字串不能混用:也就是,"
"你不能用 byte 模式配對 Unicode 字串,反之亦然;同樣地,替換時,用來替換的字串"
"必須與模式和搜尋字串是相同的型別 (type)。"
#: ../../library/re.rst:24
msgid ""
"Regular expressions use the backslash character (``'\\'``) to indicate "
"special forms or to allow special characters to be used without invoking "
"their special meaning. This collides with Python's usage of the same "
"character for the same purpose in string literals; for example, to match a "
"literal backslash, one might have to write ``'\\\\\\\\'`` as the pattern "
"string, because the regular expression must be ``\\\\``, and each backslash "
"must be expressed as ``\\\\`` inside a regular Python string literal. Also, "
"please note that any invalid escape sequences in Python's usage of the "
"backslash in string literals now generate a :exc:`SyntaxWarning` and in the "
"future this will become a :exc:`SyntaxError`. This behaviour will happen "
"even if it is a valid escape sequence for a regular expression."
msgstr ""
"正規表示式使用反斜線字元 (``'\\'``) 表示特別的形式,或是使用特殊字元而不調用"
"它們的特殊意義。這與 Python 在字串文本 (literal) 中,為了一樣的目的使用同一個"
"字元的目的相衝突;舉例來說,為了配對一個反斜線文字,一個人可能需要寫 ``'\\\\"
"\\\\'`` 當作模式字串,因為正規表示式必須是 ``\\\\``,而且每個反斜線在一個普通"
"的 Python 字串文本中必須表示為 ``\\\\``。另外,請注意在 Python 的字串文本中使"
"用反斜線的任何無效跳脫序列目前會產生一個 :exc:`SyntaxWarning`,而在未來這會變"
"成一個 :exc:`SyntaxError`。儘管它對正規表示式是一個有效的跳脫序列,這種行為也"
"會發生。"
#: ../../library/re.rst:36
msgid ""
"The solution is to use Python's raw string notation for regular expression "
"patterns; backslashes are not handled in any special way in a string literal "
"prefixed with ``'r'``. So ``r\"\\n\"`` is a two-character string containing "
"``'\\'`` and ``'n'``, while ``\"\\n\"`` is a one-character string containing "
"a newline. Usually patterns will be expressed in Python code using this raw "
"string notation."
msgstr ""
"解決方法是對正規表示式模式使用 Python 的原始字串符號;反斜線在一個以 ``'r'`` "
"為前綴的字串文本中不會被用任何特別的方式處理。所以 ``r\"\\n\"`` 是一個兩個字"
"元的字串,包含 ``'\\'`` 和 ``'n'``,同時 ``\"\\n\"`` 是一個單個字元的字串,包"
"含一個換行符號。通常模式在 Python 程式中會使用這個原始字串符號表示。"
#: ../../library/re.rst:43
msgid ""
"It is important to note that most regular expression operations are "
"available as module-level functions and methods on :ref:`compiled regular "
"expressions <re-objects>`. The functions are shortcuts that don't require "
"you to compile a regex object first, but miss some fine-tuning parameters."
msgstr ""
"請務必注意到大部分的正規表示式操作是可以在模組層級的函式和 :ref:`compiled "
"regular expressions <re-objects>` 中的方法使用的。這些函式是個捷徑且讓你不需"
"要先編譯一個正規表示式物件,但是會缺少一些微調參數。"
#: ../../library/re.rst:51
msgid ""
"The third-party :pypi:`regex` module, which has an API compatible with the "
"standard library :mod:`re` module, but offers additional functionality and a "
"more thorough Unicode support."
msgstr ""
"第三方的 :pypi:`regex` 模組,有著和標準函式庫 :mod:`re` 模組相容的 API,但是"
"提供額外的功能以及更完整的 Unicode 支援。"
#: ../../library/re.rst:59
msgid "Regular Expression Syntax"
msgstr "正規表示式語法"
#: ../../library/re.rst:61
msgid ""
"A regular expression (or RE) specifies a set of strings that matches it; the "
"functions in this module let you check if a particular string matches a "
"given regular expression (or if a given regular expression matches a "
"particular string, which comes down to the same thing)."
msgstr ""
#: ../../library/re.rst:66
msgid ""
"Regular expressions can be concatenated to form new regular expressions; if "
"*A* and *B* are both regular expressions, then *AB* is also a regular "
"expression. In general, if a string *p* matches *A* and another string *q* "
"matches *B*, the string *pq* will match AB. This holds unless *A* or *B* "
"contain low precedence operations; boundary conditions between *A* and *B*; "
"or have numbered group references. Thus, complex expressions can easily be "
"constructed from simpler primitive expressions like the ones described "
"here. For details of the theory and implementation of regular expressions, "
"consult the Friedl book [Frie09]_, or almost any textbook about compiler "
"construction."
msgstr ""
#: ../../library/re.rst:76
msgid ""
"A brief explanation of the format of regular expressions follows. For "
"further information and a gentler presentation, consult the :ref:`regex-"
"howto`."
msgstr ""
#: ../../library/re.rst:79
msgid ""
"Regular expressions can contain both special and ordinary characters. Most "
"ordinary characters, like ``'A'``, ``'a'``, or ``'0'``, are the simplest "
"regular expressions; they simply match themselves. You can concatenate "
"ordinary characters, so ``last`` matches the string ``'last'``. (In the "
"rest of this section, we'll write RE's in ``this special style``, usually "
"without quotes, and strings to be matched ``'in single quotes'``.)"
msgstr ""
#: ../../library/re.rst:86
msgid ""
"Some characters, like ``'|'`` or ``'('``, are special. Special characters "
"either stand for classes of ordinary characters, or affect how the regular "
"expressions around them are interpreted."
msgstr ""
#: ../../library/re.rst:90
msgid ""
"Repetition operators or quantifiers (``*``, ``+``, ``?``, ``{m,n}``, etc) "
"cannot be directly nested. This avoids ambiguity with the non-greedy "
"modifier suffix ``?``, and with other modifiers in other implementations. To "
"apply a second repetition to an inner repetition, parentheses may be used. "
"For example, the expression ``(?:a{6})*`` matches any multiple of six "
"``'a'`` characters."
msgstr ""
#: ../../library/re.rst:97
msgid "The special characters are:"
msgstr ""
#: ../../library/re.rst:101 ../../library/re.rst:1637
msgid "``.``"
msgstr "``.``"
#: ../../library/re.rst:102
msgid ""
"(Dot.) In the default mode, this matches any character except a newline. "
"If the :const:`DOTALL` flag has been specified, this matches any character "
"including a newline. ``(?s:.)`` matches any character regardless of flags."
msgstr ""
#: ../../library/re.rst:108
msgid "``^``"
msgstr "``^``"
#: ../../library/re.rst:109
msgid ""
"(Caret.) Matches the start of the string, and in :const:`MULTILINE` mode "
"also matches immediately after each newline."
msgstr ""
#: ../../library/re.rst:114
msgid "``$``"
msgstr "``$``"
#: ../../library/re.rst:115
msgid ""
"Matches the end of the string or just before the newline at the end of the "
"string, and in :const:`MULTILINE` mode also matches before a newline. "
"``foo`` matches both 'foo' and 'foobar', while the regular expression "
"``foo$`` matches only 'foo'. More interestingly, searching for ``foo.$`` in "
"``'foo1\\nfoo2\\n'`` matches 'foo2' normally, but 'foo1' in :const:"
"`MULTILINE` mode; searching for a single ``$`` in ``'foo\\n'`` will find two "
"(empty) matches: one just before the newline, and one at the end of the "
"string."
msgstr ""
#: ../../library/re.rst:125
msgid "``*``"
msgstr "``*``"
#: ../../library/re.rst:126
msgid ""
"Causes the resulting RE to match 0 or more repetitions of the preceding RE, "
"as many repetitions as are possible. ``ab*`` will match 'a', 'ab', or 'a' "
"followed by any number of 'b's."
msgstr ""
#: ../../library/re.rst:132
msgid "``+``"
msgstr "``+``"
#: ../../library/re.rst:133
msgid ""
"Causes the resulting RE to match 1 or more repetitions of the preceding RE. "
"``ab+`` will match 'a' followed by any non-zero number of 'b's; it will not "
"match just 'a'."
msgstr ""
#: ../../library/re.rst:139
msgid "``?``"
msgstr "``?``"
#: ../../library/re.rst:140
msgid ""
"Causes the resulting RE to match 0 or 1 repetitions of the preceding RE. "
"``ab?`` will match either 'a' or 'ab'."
msgstr ""
#: ../../library/re.rst:148
msgid "``*?``, ``+?``, ``??``"
msgstr "``*?``, ``+?``, ``??``"
#: ../../library/re.rst:149
msgid ""
"The ``'*'``, ``'+'``, and ``'?'`` quantifiers are all :dfn:`greedy`; they "
"match as much text as possible. Sometimes this behaviour isn't desired; if "
"the RE ``<.*>`` is matched against ``'<a> b <c>'``, it will match the entire "
"string, and not just ``'<a>'``. Adding ``?`` after the quantifier makes it "
"perform the match in :dfn:`non-greedy` or :dfn:`minimal` fashion; as *few* "
"characters as possible will be matched. Using the RE ``<.*?>`` will match "
"only ``'<a>'``."
msgstr ""
#: ../../library/re.rst:162
msgid "``*+``, ``++``, ``?+``"
msgstr "``*+``, ``++``, ``?+``"
#: ../../library/re.rst:163
msgid ""
"Like the ``'*'``, ``'+'``, and ``'?'`` quantifiers, those where ``'+'`` is "
"appended also match as many times as possible. However, unlike the true "
"greedy quantifiers, these do not allow back-tracking when the expression "
"following it fails to match. These are known as :dfn:`possessive` "
"quantifiers. For example, ``a*a`` will match ``'aaaa'`` because the ``a*`` "
"will match all 4 ``'a'``\\ s, but, when the final ``'a'`` is encountered, "
"the expression is backtracked so that in the end the ``a*`` ends up matching "
"3 ``'a'``\\ s total, and the fourth ``'a'`` is matched by the final ``'a'``. "
"However, when ``a*+a`` is used to match ``'aaaa'``, the ``a*+`` will match "
"all 4 ``'a'``, but when the final ``'a'`` fails to find any more characters "
"to match, the expression cannot be backtracked and will thus fail to match. "
"``x*+``, ``x++`` and ``x?+`` are equivalent to ``(?>x*)``, ``(?>x+)`` and "
"``(?>x?)`` correspondingly."
msgstr ""
#: ../../library/re.rst:184
msgid "``{m}``"
msgstr "``{m}``"
#: ../../library/re.rst:185
msgid ""
"Specifies that exactly *m* copies of the previous RE should be matched; "
"fewer matches cause the entire RE not to match. For example, ``a{6}`` will "
"match exactly six ``'a'`` characters, but not five."
msgstr ""
#: ../../library/re.rst:189
msgid "``{m,n}``"
msgstr "``{m,n}``"
#: ../../library/re.rst:190
msgid ""
"Causes the resulting RE to match from *m* to *n* repetitions of the "
"preceding RE, attempting to match as many repetitions as possible. For "
"example, ``a{3,5}`` will match from 3 to 5 ``'a'`` characters. Omitting *m* "
"specifies a lower bound of zero, and omitting *n* specifies an infinite "
"upper bound. As an example, ``a{4,}b`` will match ``'aaaab'`` or a thousand "
"``'a'`` characters followed by a ``'b'``, but not ``'aaab'``. The comma may "
"not be omitted or the modifier would be confused with the previously "
"described form."
msgstr ""
#: ../../library/re.rst:198
msgid "``{m,n}?``"
msgstr "``{m,n}?``"
#: ../../library/re.rst:199
msgid ""
"Causes the resulting RE to match from *m* to *n* repetitions of the "
"preceding RE, attempting to match as *few* repetitions as possible. This is "
"the non-greedy version of the previous quantifier. For example, on the 6-"
"character string ``'aaaaaa'``, ``a{3,5}`` will match 5 ``'a'`` characters, "
"while ``a{3,5}?`` will only match 3 characters."
msgstr ""
#: ../../library/re.rst:205
msgid "``{m,n}+``"
msgstr "``{m,n}+``"
#: ../../library/re.rst:206
msgid ""
"Causes the resulting RE to match from *m* to *n* repetitions of the "
"preceding RE, attempting to match as many repetitions as possible *without* "
"establishing any backtracking points. This is the possessive version of the "
"quantifier above. For example, on the 6-character string ``'aaaaaa'``, "
"``a{3,5}+aa`` attempt to match 5 ``'a'`` characters, then, requiring 2 more "
"``'a'``\\ s, will need more characters than available and thus fail, while "
"``a{3,5}aa`` will match with ``a{3,5}`` capturing 5, then 4 ``'a'``\\ s by "
"backtracking and then the final 2 ``'a'``\\ s are matched by the final "
"``aa`` in the pattern. ``x{m,n}+`` is equivalent to ``(?>x{m,n})``."
msgstr ""
#: ../../library/re.rst:222
msgid "``\\``"
msgstr "``\\``"
#: ../../library/re.rst:223
msgid ""
"Either escapes special characters (permitting you to match characters like "
"``'*'``, ``'?'``, and so forth), or signals a special sequence; special "
"sequences are discussed below."
msgstr ""
#: ../../library/re.rst:227
msgid ""
"If you're not using a raw string to express the pattern, remember that "
"Python also uses the backslash as an escape sequence in string literals; if "
"the escape sequence isn't recognized by Python's parser, the backslash and "
"subsequent character are included in the resulting string. However, if "
"Python would recognize the resulting sequence, the backslash should be "
"repeated twice. This is complicated and hard to understand, so it's highly "
"recommended that you use raw strings for all but the simplest expressions."
msgstr ""
#: ../../library/re.rst:238
msgid "``[]``"
msgstr "``[]``"
#: ../../library/re.rst:239
msgid "Used to indicate a set of characters. In a set:"
msgstr ""
#: ../../library/re.rst:241
msgid ""
"Characters can be listed individually, e.g. ``[amk]`` will match ``'a'``, "
"``'m'``, or ``'k'``."
msgstr ""
#: ../../library/re.rst:246
msgid ""
"Ranges of characters can be indicated by giving two characters and "
"separating them by a ``'-'``, for example ``[a-z]`` will match any lowercase "
"ASCII letter, ``[0-5][0-9]`` will match all the two-digits numbers from "
"``00`` to ``59``, and ``[0-9A-Fa-f]`` will match any hexadecimal digit. If "
"``-`` is escaped (e.g. ``[a\\-z]``) or if it's placed as the first or last "
"character (e.g. ``[-a]`` or ``[a-]``), it will match a literal ``'-'``."
msgstr ""
#: ../../library/re.rst:253
msgid ""
"Special characters lose their special meaning inside sets. For example, "
"``[(+*)]`` will match any of the literal characters ``'('``, ``'+'``, "
"``'*'``, or ``')'``."
msgstr ""
#: ../../library/re.rst:259
msgid ""
"Character classes such as ``\\w`` or ``\\S`` (defined below) are also "
"accepted inside a set, although the characters they match depend on the "
"flags_ used."
msgstr ""
#: ../../library/re.rst:264
msgid ""
"Characters that are not within a range can be matched by :dfn:"
"`complementing` the set. If the first character of the set is ``'^'``, all "
"the characters that are *not* in the set will be matched. For example, "
"``[^5]`` will match any character except ``'5'``, and ``[^^]`` will match "
"any character except ``'^'``. ``^`` has no special meaning if it's not the "
"first character in the set."
msgstr ""
#: ../../library/re.rst:271
msgid ""
"To match a literal ``']'`` inside a set, precede it with a backslash, or "
"place it at the beginning of the set. For example, both ``[()[\\]{}]`` and "
"``[]()[{}]`` will match a right bracket, as well as left bracket, braces, "
"and parentheses."
msgstr ""
#: ../../library/re.rst:281
msgid ""
"Support of nested sets and set operations as in `Unicode Technical Standard "
"#18`_ might be added in the future. This would change the syntax, so to "
"facilitate this change a :exc:`FutureWarning` will be raised in ambiguous "
"cases for the time being. That includes sets starting with a literal ``'['`` "
"or containing literal character sequences ``'--'``, ``'&&'``, ``'~~'``, and "
"``'||'``. To avoid a warning escape them with a backslash."
msgstr ""
#: ../../library/re.rst:291
msgid ""
":exc:`FutureWarning` is raised if a character set contains constructs that "
"will change semantically in the future."
msgstr ""
#: ../../library/re.rst:297
msgid "``|``"
msgstr "``|``"
#: ../../library/re.rst:298
msgid ""
"``A|B``, where *A* and *B* can be arbitrary REs, creates a regular "
"expression that will match either *A* or *B*. An arbitrary number of REs "
"can be separated by the ``'|'`` in this way. This can be used inside groups "
"(see below) as well. As the target string is scanned, REs separated by "
"``'|'`` are tried from left to right. When one pattern completely matches, "
"that branch is accepted. This means that once *A* matches, *B* will not be "
"tested further, even if it would produce a longer overall match. In other "
"words, the ``'|'`` operator is never greedy. To match a literal ``'|'``, "
"use ``\\|``, or enclose it inside a character class, as in ``[|]``."
msgstr ""
#: ../../library/re.rst:311
msgid "``(...)``"
msgstr "``(...)``"
#: ../../library/re.rst:312
msgid ""
"Matches whatever regular expression is inside the parentheses, and indicates "
"the start and end of a group; the contents of a group can be retrieved after "
"a match has been performed, and can be matched later in the string with the "
"``\\number`` special sequence, described below. To match the literals "
"``'('`` or ``')'``, use ``\\(`` or ``\\)``, or enclose them inside a "
"character class: ``[(]``, ``[)]``."
msgstr ""
#: ../../library/re.rst:320
msgid "``(?...)``"
msgstr "``(?...)``"
#: ../../library/re.rst:321
msgid ""
"This is an extension notation (a ``'?'`` following a ``'('`` is not "
"meaningful otherwise). The first character after the ``'?'`` determines "
"what the meaning and further syntax of the construct is. Extensions usually "
"do not create a new group; ``(?P<name>...)`` is the only exception to this "
"rule. Following are the currently supported extensions."
msgstr ""
#: ../../library/re.rst:327
msgid "``(?aiLmsux)``"
msgstr "``(?aiLmsux)``"
#: ../../library/re.rst:328
msgid ""
"(One or more letters from the set ``'a'``, ``'i'``, ``'L'``, ``'m'``, "
"``'s'``, ``'u'``, ``'x'``.) The group matches the empty string; the letters "
"set the corresponding flags for the entire regular expression:"
msgstr ""
#: ../../library/re.rst:333 ../../library/re.rst:365
msgid ":const:`re.A` (ASCII-only matching)"
msgstr ""
#: ../../library/re.rst:334 ../../library/re.rst:366
msgid ":const:`re.I` (ignore case)"
msgstr ""
#: ../../library/re.rst:335 ../../library/re.rst:367
msgid ":const:`re.L` (locale dependent)"
msgstr ""
#: ../../library/re.rst:336 ../../library/re.rst:368
msgid ":const:`re.M` (multi-line)"
msgstr ""
#: ../../library/re.rst:337 ../../library/re.rst:369
msgid ":const:`re.S` (dot matches all)"
msgstr ""
#: ../../library/re.rst:338 ../../library/re.rst:370
msgid ":const:`re.U` (Unicode matching)"
msgstr ""
#: ../../library/re.rst:339 ../../library/re.rst:371
msgid ":const:`re.X` (verbose)"
msgstr ""
#: ../../library/re.rst:341
msgid ""
"(The flags are described in :ref:`contents-of-module-re`.) This is useful if "
"you wish to include the flags as part of the regular expression, instead of "
"passing a *flag* argument to the :func:`re.compile` function. Flags should "
"be used first in the expression string."
msgstr ""
#: ../../library/re.rst:347
msgid "This construction can only be used at the start of the expression."
msgstr ""
#: ../../library/re.rst:352
msgid "``(?:...)``"
msgstr "``(?:...)``"
#: ../../library/re.rst:353
msgid ""
"A non-capturing version of regular parentheses. Matches whatever regular "
"expression is inside the parentheses, but the substring matched by the group "
"*cannot* be retrieved after performing a match or referenced later in the "
"pattern."
msgstr ""
#: ../../library/re.rst:358
msgid "``(?aiLmsux-imsx:...)``"
msgstr "``(?aiLmsux-imsx:...)``"
#: ../../library/re.rst:359
msgid ""
"(Zero or more letters from the set ``'a'``, ``'i'``, ``'L'``, ``'m'``, "
"``'s'``, ``'u'``, ``'x'``, optionally followed by ``'-'`` followed by one or "
"more letters from the ``'i'``, ``'m'``, ``'s'``, ``'x'``.) The letters set "
"or remove the corresponding flags for the part of the expression:"
msgstr ""
#: ../../library/re.rst:373
msgid "(The flags are described in :ref:`contents-of-module-re`.)"
msgstr ""
#: ../../library/re.rst:375
msgid ""
"The letters ``'a'``, ``'L'`` and ``'u'`` are mutually exclusive when used as "
"inline flags, so they can't be combined or follow ``'-'``. Instead, when "
"one of them appears in an inline group, it overrides the matching mode in "
"the enclosing group. In Unicode patterns ``(?a:...)`` switches to ASCII-"
"only matching, and ``(?u:...)`` switches to Unicode matching (default). In "
"bytes patterns ``(?L:...)`` switches to locale dependent matching, and ``(?"
"a:...)`` switches to ASCII-only matching (default). This override is only in "
"effect for the narrow inline group, and the original matching mode is "
"restored outside of the group."
msgstr ""
#: ../../library/re.rst:387
msgid "The letters ``'a'``, ``'L'`` and ``'u'`` also can be used in a group."
msgstr ""
#: ../../library/re.rst:390
msgid "``(?>...)``"
msgstr "``(?>...)``"
#: ../../library/re.rst:391
msgid ""
"Attempts to match ``...`` as if it was a separate regular expression, and if "
"successful, continues to match the rest of the pattern following it. If the "
"subsequent pattern fails to match, the stack can only be unwound to a point "
"*before* the ``(?>...)`` because once exited, the expression, known as an :"
"dfn:`atomic group`, has thrown away all stack points within itself. Thus, "
"``(?>.*).`` would never match anything because first the ``.*`` would match "
"all characters possible, then, having nothing left to match, the final ``.`` "
"would fail to match. Since there are no stack points saved in the Atomic "
"Group, and there is no stack point before it, the entire expression would "
"thus fail to match."
msgstr ""
#: ../../library/re.rst:407
msgid "``(?P<name>...)``"
msgstr "``(?P<name>...)``"
#: ../../library/re.rst:408
msgid ""
"Similar to regular parentheses, but the substring matched by the group is "
"accessible via the symbolic group name *name*. Group names must be valid "
"Python identifiers, and in :class:`bytes` patterns they can only contain "
"bytes in the ASCII range. Each group name must be defined only once within "
"a regular expression. A symbolic group is also a numbered group, just as if "
"the group were not named."
msgstr ""
#: ../../library/re.rst:415
msgid ""
"Named groups can be referenced in three contexts. If the pattern is ``(?"
"P<quote>['\"]).*?(?P=quote)`` (i.e. matching a string quoted with either "
"single or double quotes):"
msgstr ""
#: ../../library/re.rst:420
msgid "Context of reference to group \"quote\""
msgstr ""
#: ../../library/re.rst:420
msgid "Ways to reference it"
msgstr ""
#: ../../library/re.rst:422
msgid "in the same pattern itself"
msgstr ""
#: ../../library/re.rst:422
msgid "``(?P=quote)`` (as shown)"
msgstr ""
#: ../../library/re.rst:423 ../../library/re.rst:430
msgid "``\\1``"
msgstr "``\\1``"
#: ../../library/re.rst:425
msgid "when processing match object *m*"
msgstr ""
#: ../../library/re.rst:425
msgid "``m.group('quote')``"
msgstr "``m.group('quote')``"
#: ../../library/re.rst:426
msgid "``m.end('quote')`` (etc.)"
msgstr ""
#: ../../library/re.rst:428
msgid "in a string passed to the *repl* argument of ``re.sub()``"
msgstr ""
#: ../../library/re.rst:428
msgid "``\\g<quote>``"
msgstr "``\\g<quote>``"
#: ../../library/re.rst:429
msgid "``\\g<1>``"
msgstr "``\\g<1>``"
#: ../../library/re.rst:433
msgid ""
"In :class:`bytes` patterns, group *name* can only contain bytes in the ASCII "
"range (``b'\\x00'``-``b'\\x7f'``)."
msgstr ""
#: ../../library/re.rst:439
msgid "``(?P=name)``"
msgstr "``(?P=name)``"
#: ../../library/re.rst:440
msgid ""
"A backreference to a named group; it matches whatever text was matched by "
"the earlier group named *name*."
msgstr ""
#: ../../library/re.rst:445
msgid "``(?#...)``"
msgstr "``(?#...)``"
#: ../../library/re.rst:446
msgid "A comment; the contents of the parentheses are simply ignored."
msgstr ""
#: ../../library/re.rst:450
msgid "``(?=...)``"
msgstr "``(?=...)``"
#: ../../library/re.rst:451
msgid ""
"Matches if ``...`` matches next, but doesn't consume any of the string. "
"This is called a :dfn:`lookahead assertion`. For example, ``Isaac (?"
"=Asimov)`` will match ``'Isaac '`` only if it's followed by ``'Asimov'``."
msgstr ""
#: ../../library/re.rst:457
msgid "``(?!...)``"
msgstr "``(?!...)``"
#: ../../library/re.rst:458
msgid ""
"Matches if ``...`` doesn't match next. This is a :dfn:`negative lookahead "
"assertion`. For example, ``Isaac (?!Asimov)`` will match ``'Isaac '`` only "
"if it's *not* followed by ``'Asimov'``."
msgstr ""
#: ../../library/re.rst:464
msgid "``(?<=...)``"
msgstr "``(?<=...)``"
#: ../../library/re.rst:465
msgid ""
"Matches if the current position in the string is preceded by a match for "
"``...`` that ends at the current position. This is called a :dfn:`positive "
"lookbehind assertion`. ``(?<=abc)def`` will find a match in ``'abcdef'``, "
"since the lookbehind will back up 3 characters and check if the contained "
"pattern matches. The contained pattern must only match strings of some fixed "
"length, meaning that ``abc`` or ``a|b`` are allowed, but ``a*`` and ``a{3,4}"
"`` are not. Note that patterns which start with positive lookbehind "
"assertions will not match at the beginning of the string being searched; you "
"will most likely want to use the :func:`search` function rather than the :"
"func:`match` function:"
msgstr ""
#: ../../library/re.rst:480
msgid "This example looks for a word following a hyphen:"
msgstr ""
#: ../../library/re.rst:486
msgid "Added support for group references of fixed length."
msgstr ""
#: ../../library/re.rst:491
msgid "``(?<!...)``"
msgstr "``(?<!...)``"
#: ../../library/re.rst:492
msgid ""
"Matches if the current position in the string is not preceded by a match for "
"``...``. This is called a :dfn:`negative lookbehind assertion`. Similar to "
"positive lookbehind assertions, the contained pattern must only match "
"strings of some fixed length. Patterns which start with negative lookbehind "
"assertions may match at the beginning of the string being searched."
msgstr ""
#: ../../library/re.rst:501
msgid "``(?(id/name)yes-pattern|no-pattern)``"
msgstr "``(?(id/name)yes-pattern|no-pattern)``"
#: ../../library/re.rst:502
msgid ""
"Will try to match with ``yes-pattern`` if the group with given *id* or "
"*name* exists, and with ``no-pattern`` if it doesn't. ``no-pattern`` is "
"optional and can be omitted. For example, ``(<)?(\\w+@\\w+(?:\\.\\w+)+)(?"
"(1)>|$)`` is a poor email matching pattern, which will match with "
"``'<user@host.com>'`` as well as ``'user@host.com'``, but not with "
"``'<user@host.com'`` nor ``'user@host.com>'``."
msgstr ""
#: ../../library/re.rst:509
msgid ""
"Group *id* can only contain ASCII digits. In :class:`bytes` patterns, group "
"*name* can only contain bytes in the ASCII range (``b'\\x00'``-``b'\\x7f'``)."
msgstr ""
#: ../../library/re.rst:517
msgid ""
"The special sequences consist of ``'\\'`` and a character from the list "
"below. If the ordinary character is not an ASCII digit or an ASCII letter, "
"then the resulting RE will match the second character. For example, ``\\$`` "
"matches the character ``'$'``."
msgstr ""
#: ../../library/re.rst:524
msgid "``\\number``"
msgstr "``\\number``"
#: ../../library/re.rst:525
msgid ""
"Matches the contents of the group of the same number. Groups are numbered "
"starting from 1. For example, ``(.+) \\1`` matches ``'the the'`` or ``'55 "
"55'``, but not ``'thethe'`` (note the space after the group). This special "
"sequence can only be used to match one of the first 99 groups. If the first "
"digit of *number* is 0, or *number* is 3 octal digits long, it will not be "
"interpreted as a group match, but as the character with octal value "
"*number*. Inside the ``'['`` and ``']'`` of a character class, all numeric "
"escapes are treated as characters."
msgstr ""
#: ../../library/re.rst:536
msgid "``\\A``"
msgstr "``\\A``"
#: ../../library/re.rst:537
msgid "Matches only at the start of the string."
msgstr ""
#: ../../library/re.rst:541
msgid "``\\b``"
msgstr "``\\b``"
#: ../../library/re.rst:542
msgid ""
"Matches the empty string, but only at the beginning or end of a word. A word "
"is defined as a sequence of word characters. Note that formally, ``\\b`` is "
"defined as the boundary between a ``\\w`` and a ``\\W`` character (or vice "
"versa), or between ``\\w`` and the beginning or end of the string. This "
"means that ``r'\\bat\\b'`` matches ``'at'``, ``'at.'``, ``'(at)'``, and "
"``'as at ay'`` but not ``'attempt'`` or ``'atlas'``."
msgstr ""
#: ../../library/re.rst:550
msgid ""
"The default word characters in Unicode (str) patterns are Unicode "
"alphanumerics and the underscore, but this can be changed by using the :py:"
"const:`~re.ASCII` flag. Word boundaries are determined by the current locale "
"if the :py:const:`~re.LOCALE` flag is used."
msgstr ""
#: ../../library/re.rst:558
msgid ""
"Inside a character range, ``\\b`` represents the backspace character, for "
"compatibility with Python's string literals."
msgstr ""
#: ../../library/re.rst:563
msgid "``\\B``"
msgstr "``\\B``"
#: ../../library/re.rst:564
msgid ""
"Matches the empty string, but only when it is *not* at the beginning or end "
"of a word. This means that ``r'at\\B'`` matches ``'athens'``, ``'atom'``, "
"``'attorney'``, but not ``'at'``, ``'at.'``, or ``'at!'``. ``\\B`` is the "
"opposite of ``\\b``, so word characters in Unicode (str) patterns are "
"Unicode alphanumerics or the underscore, although this can be changed by "
"using the :py:const:`~re.ASCII` flag. Word boundaries are determined by the "
"current locale if the :py:const:`~re.LOCALE` flag is used."
msgstr ""
#: ../../library/re.rst:577
msgid "``\\d``"
msgstr "``\\d``"
#: ../../library/re.rst:578 ../../library/re.rst:602 ../../library/re.rst:624
msgid "For Unicode (str) patterns:"
msgstr ""
#: ../../library/re.rst:579
msgid ""
"Matches any Unicode decimal digit (that is, any character in Unicode "
"character category `[Nd]`__). This includes ``[0-9]``, and also many other "
"digit characters."
msgstr ""
#: ../../library/re.rst:583
msgid "Matches ``[0-9]`` if the :py:const:`~re.ASCII` flag is used."
msgstr ""
#: ../../library/re.rst:587 ../../library/re.rst:609 ../../library/re.rst:632
msgid "For 8-bit (bytes) patterns:"
msgstr ""
#: ../../library/re.rst:588
msgid ""
"Matches any decimal digit in the ASCII character set; this is equivalent to "
"``[0-9]``."
msgstr ""
#: ../../library/re.rst:593
msgid "``\\D``"
msgstr "``\\D``"
#: ../../library/re.rst:594
msgid ""
"Matches any character which is not a decimal digit. This is the opposite of "
"``\\d``."
msgstr ""
#: ../../library/re.rst:597
msgid "Matches ``[^0-9]`` if the :py:const:`~re.ASCII` flag is used."
msgstr ""
#: ../../library/re.rst:601
msgid "``\\s``"
msgstr "``\\s``"
#: ../../library/re.rst:603
msgid ""
"Matches Unicode whitespace characters (as defined by :py:meth:`str."
"isspace`). This includes ``[ \\t\\n\\r\\f\\v]``, and also many other "
"characters, for example the non-breaking spaces mandated by typography rules "
"in many languages."
msgstr ""
#: ../../library/re.rst:607
msgid ""
"Matches ``[ \\t\\n\\r\\f\\v]`` if the :py:const:`~re.ASCII` flag is used."
msgstr ""
#: ../../library/re.rst:610
msgid ""
"Matches characters considered whitespace in the ASCII character set; this is "
"equivalent to ``[ \\t\\n\\r\\f\\v]``."
msgstr ""
#: ../../library/re.rst:615
msgid "``\\S``"
msgstr "``\\S``"
#: ../../library/re.rst:616
msgid ""
"Matches any character which is not a whitespace character. This is the "
"opposite of ``\\s``."
msgstr ""
#: ../../library/re.rst:619
msgid ""
"Matches ``[^ \\t\\n\\r\\f\\v]`` if the :py:const:`~re.ASCII` flag is used."
msgstr ""
#: ../../library/re.rst:623
msgid "``\\w``"
msgstr "``\\w``"
#: ../../library/re.rst:625
msgid ""
"Matches Unicode word characters; this includes all Unicode alphanumeric "
"characters (as defined by :py:meth:`str.isalnum`), as well as the underscore "
"(``_``)."
msgstr ""
#: ../../library/re.rst:630
msgid "Matches ``[a-zA-Z0-9_]`` if the :py:const:`~re.ASCII` flag is used."
msgstr ""
#: ../../library/re.rst:633
msgid ""
"Matches characters considered alphanumeric in the ASCII character set; this "
"is equivalent to ``[a-zA-Z0-9_]``. If the :py:const:`~re.LOCALE` flag is "
"used, matches characters considered alphanumeric in the current locale and "
"the underscore."
msgstr ""
#: ../../library/re.rst:640
msgid "``\\W``"
msgstr "``\\W``"
#: ../../library/re.rst:641
msgid ""
"Matches any character which is not a word character. This is the opposite of "
"``\\w``. By default, matches non-underscore (``_``) characters for which :py:"
"meth:`str.isalnum` returns ``False``."
msgstr ""
#: ../../library/re.rst:646
msgid "Matches ``[^a-zA-Z0-9_]`` if the :py:const:`~re.ASCII` flag is used."
msgstr ""
#: ../../library/re.rst:648
msgid ""
"If the :py:const:`~re.LOCALE` flag is used, matches characters which are "
"neither alphanumeric in the current locale nor the underscore."
msgstr ""
#: ../../library/re.rst:654
msgid "``\\Z``"
msgstr "``\\Z``"
#: ../../library/re.rst:655
msgid "Matches only at the end of the string."
msgstr ""
#: ../../library/re.rst:671
msgid ""
"Most of the :ref:`escape sequences <escape-sequences>` supported by Python "
"string literals are also accepted by the regular expression parser::"
msgstr ""
#: ../../library/re.rst:674
msgid ""
"\\a \\b \\f \\n\n"
"\\N \\r \\t \\u\n"
"\\U \\v \\x \\\\"
msgstr ""
"\\a \\b \\f \\n\n"
"\\N \\r \\t \\u\n"
"\\U \\v \\x \\\\"
#: ../../library/re.rst:678
msgid ""
"(Note that ``\\b`` is used to represent word boundaries, and means "
"\"backspace\" only inside character classes.)"
msgstr ""
#: ../../library/re.rst:681
msgid ""
"``'\\u'``, ``'\\U'``, and ``'\\N'`` escape sequences are only recognized in "
"Unicode (str) patterns. In bytes patterns they are errors. Unknown escapes "
"of ASCII letters are reserved for future use and treated as errors."
msgstr ""
#: ../../library/re.rst:687
msgid ""
"Octal escapes are included in a limited form. If the first digit is a 0, or "
"if there are three octal digits, it is considered an octal escape. "
"Otherwise, it is a group reference. As for string literals, octal escapes "
"are always at most three digits in length."
msgstr ""