FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-docs-ko/howto/regex.po at 3.8 · python/python-docs-ko · GitHub
python
python-docs-ko
Repository navigation
Code
Issues
377
(377)
Pull requests
1
(1)
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
python-docs-ko
/
howto
/
regex.po
Copy path
More file actions
More file actions
Latest commit
History
History
History
2300 lines (2013 loc) · 121 KB
Breadcrumbs
python-docs-ko
/
howto
/
regex.po
Copy path
File metadata and controls
2300 lines (2013 loc) · 121 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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-2017, Python Software Foundation
#
This file is distributed under the same license as the Python package.
#
FIRST AUTHOR <EMAIL@ADDRESS>, 2017.
#
msgid ""
msgstr ""
"
Project-Id-Version
:
Python 3.6\n
"
"
Report-Msgid-Bugs-To
:
\n
"
"
POT-Creation-Date
:
2019-10-15 07:19+0900\n
"
"
PO-Revision-Date
:
YEAR-MO-DA HO:MI+ZONE\n
"
"
Last-Translator
:
Dong-gweon Oh <flowdas@gmail.com>\n
"
"
Language-Team
:
Korean (https://python.flowdas.com)\n
"
"
MIME-Version
:
1.0\n
"
"
Content-Type
:
text/plain; charset=utf-8\n
"
"
Content-Transfer-Encoding
:
8bit\n
"
"
Generated-By
:
Babel 2.7.0\n
"
#:
../Doc/howto/regex.rst:5
msgid
"Regular Expression HOWTO"
msgstr
"정규식 HOWTO"
#:
../Doc/howto/regex.rst
msgid
"Author"
msgstr
"저자"
#:
../Doc/howto/regex.rst:7
msgid
"A.M. Kuchling <amk@amk.ca>"
msgstr
"A.M. Kuchling <amk@amk.ca>"
msgid
"Abstract"
msgstr
"요약"
#:
../Doc/howto/regex.rst:18
msgid
""
"This document is an introductory tutorial to using regular expressions in"
" Python with the :mod:`re` module. It provides a gentler introduction "
"than the corresponding section in the Library Reference."
msgstr
""
"이 설명서는 파이썬에서 :mod:`re` 모듈로 정규식을 사용하는 방법을 소개하는 입문서입니다. 라이브러리 레퍼런스의 해당 절보다 "
"더 부드러운 소개를 제공합니다."
#:
../Doc/howto/regex.rst:24
msgid
"Introduction"
msgstr
"소개"
#:
../Doc/howto/regex.rst:26
msgid
""
"Regular expressions (called REs, or regexes, or regex patterns) are "
"essentially a tiny, highly specialized programming language embedded "
"inside Python and made available through the :mod:`re` module. Using this"
" little language, you specify the rules for the set of possible strings "
"that you want to match; this set might contain English sentences, or "
"e-mail addresses, or TeX commands, or anything you like. You can then "
"ask questions such as
\"
Does this string match the pattern?
\"
, or
\"
Is "
"there a match for the pattern anywhere in this string?
\"
. You can also "
"use REs to modify a string or to split it apart in various ways."
msgstr
""
"정규식(RE, regexes 또는 regex 패턴이라고 불립니다)은 본질적으로 파이썬에 내장된 매우 작고 고도로 특수화된 프로그래밍"
" 언어이며, :mod:`re` 모듈을 통해 사용할 수 있습니다. 이 작은 언어를 사용하여, 일치시키려는 가능한 문자열 집합에 대한 "
"규칙을 지정합니다; 이 집합은 영어 문장, 전자 메일 주소, TeX 명령 또는 원하는 어떤 것이건 포함 할 수 있습니다. 그런 다음"
"
\"
이 문자열이 패턴과 일치합니까?
\"
, 또는
\"
이 문자열의 어느 부분에 패턴과 일치하는 것이 있습니까?
\"
와 같은 질문을 할 "
"수 있습니다. 또한 RE를 사용하여 문자열을 수정하거나 여러 방법으로 분할할 수 있습니다."
#:
../Doc/howto/regex.rst:35
msgid
""
"Regular expression patterns are compiled into a series of bytecodes which"
" are then executed by a matching engine written in C. For advanced use, "
"it may be necessary to pay careful attention to how the engine will "
"execute a given RE, and write the RE in a certain way in order to produce"
" bytecode that runs faster. Optimization isn't covered in this document, "
"because it requires that you have a good understanding of the matching "
"engine's internals."
msgstr
""
"정규식 패턴은 일련의 바이트 코드로 컴파일된 다음 C로 작성된 일치 엔진에 의해 실행됩니다. 고급 사용을 위해서는, 엔진이 지정된 "
"RE를 실행하는 방법에 주의를 기울이고, 더 빠르게 실행되는 바이트 코드를 생성하기 위해 특정한 방법으로 RE를 작성하는 것이 "
"필요할 수 있습니다. 최적화는 일치 엔진의 내부를 잘 이해하고 있어야 하므로 이 설명서에서 다루지 않습니다."
#:
../Doc/howto/regex.rst:42
msgid
""
"The regular expression language is relatively small and restricted, so "
"not all possible string processing tasks can be done using regular "
"expressions. There are also tasks that *can* be done with regular "
"expressions, but the expressions turn out to be very complicated. In "
"these cases, you may be better off writing Python code to do the "
"processing; while Python code will be slower than an elaborate regular "
"expression, it will also probably be more understandable."
msgstr
""
"정규식 언어는 비교적 작고 제한적이므로, 정규식을 사용하여 가능한 모든 문자열 처리 작업을 수행할 수 있는 것은 아닙니다. "
"정규식으로 수행할 *수*
\\
는 있지만, 표현이 아주 복잡해지는 작업도 있습니다. 이럴 때, 처리하기 위한 파이썬 코드를 작성하는 "
"것이 더 나을 수 있습니다; 파이썬 코드는 정교한 정규식보다 느리겠지만, 아마도 더 이해하기 쉬울 겁니다."
#:
../Doc/howto/regex.rst:51
msgid
"Simple Patterns"
msgstr
"단순한 패턴"
#:
../Doc/howto/regex.rst:53
msgid
""
"We'll start by learning about the simplest possible regular expressions."
" Since regular expressions are used to operate on strings, we'll begin "
"with the most common task: matching characters."
msgstr
""
"우리는 가능한 가장 단순한 정규식에 대해 배우는 것으로 시작합니다. 정규식은 문자열에 대한 연산에 사용되므로, 가장 일반적인 "
"작업으로 시작하겠습니다: 문자 일치."
#:
../Doc/howto/regex.rst:57
msgid
""
"For a detailed explanation of the computer science underlying regular "
"expressions (deterministic and non-deterministic finite automata), you "
"can refer to almost any textbook on writing compilers."
msgstr
""
"정규식의 기초가 되는 컴퓨터 과학(결정적인 혹은 비결정적인 유한 오토마타)에 대한 자세한 설명은, 컴파일러 작성에 관한 거의 모든 "
"교과서를 참조 할 수 있습니다."
#:
../Doc/howto/regex.rst:63
msgid
"Matching Characters"
msgstr
"문자 일치"
#:
../Doc/howto/regex.rst:65
msgid
""
"Most letters and characters will simply match themselves. For example, "
"the regular expression ``test`` will match the string ``test`` exactly. "
"(You can enable a case-insensitive mode that would let this RE match "
"``Test`` or ``TEST`` as well; more about this later.)"
msgstr
""
"대부분 글자와 문자는 단순히 자신과 일치합니다. 예를 들어, 정규식 ``test``
\\
는 문자열 ``test``
\\
와 정확히 "
"일치합니다. (이 RE가 ``Test``
\\
나 ``TEST``
\\
와 일치하도록 대/소문자를 구분하지 않는 모드를 활성화할 수 "
"있습니다; 나중에 자세히 설명합니다.)"
#:
../Doc/howto/regex.rst:70
msgid
""
"There are exceptions to this rule; some characters are special "
":dfn:`metacharacters`, and don't match themselves. Instead, they signal "
"that some out-of-the-ordinary thing should be matched, or they affect "
"other portions of the RE by repeating them or changing their meaning. "
"Much of this document is devoted to discussing various metacharacters and"
" what they do."
msgstr
""
"이 규칙에는 예외가 있습니다; 일부 문자는 특수한 :dfn:`메타 문자 (metacharacters)`
\\
이며, 자신과 일치하지 "
"않습니다. 그 대신, 그들은 일반적이지 않은 것을 일치시켜야 한다는 신호를 보냅니다. 또는 반복하거나 의미를 바꾸어 RE의 다른 "
"부분에 영향을 줍니다. 이 설명서의 많은 부분은 다양한 메타 문자와 그 기능에 대해 논의하는데 할애하고 있습니다."
#:
../Doc/howto/regex.rst:76
msgid
""
"Here's a complete list of the metacharacters; their meanings will be "
"discussed in the rest of this HOWTO."
msgstr
"다음은 메타 문자의 전체 목록입니다; 이것들의 의미는 이 HOWTO의 나머지 부분에서 논의될 것입니다."
#:
../Doc/howto/regex.rst:83
msgid
""
"The first metacharacters we'll look at are ``[`` and ``]``. They're used "
"for specifying a character class, which is a set of characters that you "
"wish to match. Characters can be listed individually, or a range of "
"characters can be indicated by giving two characters and separating them "
"by a ``'-'``. For example, ``[abc]`` will match any of the characters "
"``a``, ``b``, or ``c``; this is the same as ``[a-c]``, which uses a range"
" to express the same set of characters. If you wanted to match only "
"lowercase letters, your RE would be ``[a-z]``."
msgstr
""
"우리가 살펴볼 첫 번째 메타 문자는 ``[``
\\
와 ``]``
\\
입니다. 일치시키려는 문자 집합인 문자 클래스를 지정하는 데 "
"사용됩니다. 문자는 개별적으로 나열되거나, 두 문자를 주고 ``'-'``
\\
로 구분하여 문자의 범위를 나타낼 수 있습니다. 예를 "
"들어, ``[abc]`` 는 ``a``, ``b`` 또는 ``c`` 문자와 일치합니다; 이것은 ``[a-c]``
\\
와 같은데, 같은"
" 문자 집합을 표현하기 위해 범위를 사용합니다. 소문자들만 일치시키려면, RE가 ``[a-z]``
\\
가 됩니다."
#:
../Doc/howto/regex.rst:92
msgid
""
"Metacharacters are not active inside classes. For example, ``[akm$]`` "
"will match any of the characters ``'a'``, ``'k'``, ``'m'``, or ``'$'``; "
"``'$'`` is usually a metacharacter, but inside a character class it's "
"stripped of its special nature."
msgstr
""
"메타 문자는 클래스 내부에서는 활성화되지 않습니다. 예를 들어, ``[akm$]``
\\
는 ``'a'``, ``'k'``, "
"``'m'`` 또는 ``'$'`` 문자와 일치합니다; ``'$'``
\\
는 대개 메타 문자이지만, 문자 클래스 안에서는 특수한 특성이"
" 없어집니다."
#:
../Doc/howto/regex.rst:97
msgid
""
"You can match the characters not listed within the class by "
":dfn:`complementing` the set. This is indicated by including a ``'^'`` "
"as the first character of the class. For example, ``[^5]`` will match any"
" character except ``'5'``. If the caret appears elsewhere in a character"
" class, it does not have special meaning. For example: ``[5^]`` will "
"match either a ``'5'`` or a ``'^'``."
msgstr
""
":dfn:`여집합 (complement set)`
\\
을 사용해서 클래스에 나열되지 않은 문자를 일치시킬 수 있습니다. 이것은 "
"클래스의 첫 번째 문자로 ``'^'``
\\
를 포함하는 것으로 나타냅니다. 예를 들어, ``[^5]`` 는 ``'5'``
\\
를 제외한"
" 모든 문자와 일치합니다. 캐럿이 문자 클래스의 다른 곳에 나타나면, 특별한 의미가 없습니다. 예를 들어, ``[5^]`` 는 "
"``'5'``
\\
나 ``'^'``
\\
와 일치합니다."
#:
../Doc/howto/regex.rst:103
msgid
""
"Perhaps the most important metacharacter is the backslash, ``
\\
``. As "
"in Python string literals, the backslash can be followed by various "
"characters to signal various special sequences. It's also used to escape"
" all the metacharacters so you can still match them in patterns; for "
"example, if you need to match a ``[`` or ``
\\
``, you can precede them "
"with a backslash to remove their special meaning: ``
\\
[`` or ``
\\\\
``."
msgstr
""
"아마도 가장 중요한 메타 문자는 백 슬래시(``
\\
``)입니다. 파이썬 문자열 리터럴에서와 같이, 백 슬래시 다음에 다양한 특수 "
"시퀀스를 알리는 다양한 문자가 따라올 수 있습니다. 또한, 모든 메타 문자를 이스케이프 처리하여 패턴으로 일치시킬 수 있도록 "
"합니다. 예를 들어, ``[``
\\
나 ``
\\
``
\\
와 일치시켜야 할 때, 특별한 의미를 제거하기 위해 앞에 백 슬래시를 붙일 수 "
"있습니다: ``
\\
[``
\\
나 ``
\\\\
``."
#:
../Doc/howto/regex.rst:110
msgid
""
"Some of the special sequences beginning with ``'
\\
'`` represent "
"predefined sets of characters that are often useful, such as the set of "
"digits, the set of letters, or the set of anything that isn't whitespace."
msgstr
""
"``'
\\
'``
\\
로 시작하는 특수 시퀀스 중 일부는 숫자(digit) 집합, 글자(letter) 집합 또는 공백이 아닌 모든 것의"
" 집합과 같이 종종 유용한 미리 정의된 문자 집합을 나타냅니다."
#:
../Doc/howto/regex.rst:115
msgid
""
"Let's take an example: ``
\\
w`` matches any alphanumeric character. If "
"the regex pattern is expressed in bytes, this is equivalent to the class "
"``[a-zA-Z0-9_]``. If the regex pattern is a string, ``
\\
w`` will match "
"all the characters marked as letters in the Unicode database provided by "
"the :mod:`unicodedata` module. You can use the more restricted "
"definition of ``
\\
w`` in a string pattern by supplying the "
":const:`re.ASCII` flag when compiling the regular expression."
msgstr
""
"예를 들어 보겠습니다: ``
\\
w``
\\
는 모든 영숫자(alphanumeric character)와 일치합니다. 정규식 패턴을 "
"바이트열로 표현하면, 이것은 ``[a-zA-Z0-9_]`` 클래스와 동등합니다. 정규식 패턴이 문자열이면, ``
\\
w``
\\
는 "
":mod:`unicodedata` 모듈이 제공하는 유니코드 데이터베이스에서 글자(letter)로 표시된 모든 문자를 일치시킵니다. "
"정규식을 컴파일할 때 :const:`re.ASCII` 플래그를 제공하여 문자열 패턴에서 ``
\\
w``
\\
의 더 제한된 정의를 사용할"
" 수 있습니다."
#:
../Doc/howto/regex.rst:123
msgid
""
"The following list of special sequences isn't complete. For a complete "
"list of sequences and expanded class definitions for Unicode string "
"patterns, see the last part of :ref:`Regular Expression Syntax <re-"
"syntax>` in the Standard Library reference. In general, the Unicode "
"versions match any character that's in the appropriate category in the "
"Unicode database."
msgstr
""
"다음 특수 시퀀스 목록은 완전하지 않습니다. 유니코드 문자열 패턴에 대한 시퀀스와 확장 클래스 정의의 전체 목록은, 표준 라이브러리"
" 레퍼런스에서 :ref:`정규식 문법 <re-syntax>`
\\
의 마지막 부분을 참조하십시오. 일반적으로, 유니코드 버전은 유니코드"
" 데이터베이스의 적절한 범주에 있는 모든 문자와 일치합니다."
#:
../Doc/howto/regex.rst:131
msgid
"``
\\
d``"
msgstr
"``
\\
d``"
#:
../Doc/howto/regex.rst:131
msgid
"Matches any decimal digit; this is equivalent to the class ``[0-9]``."
msgstr
"모든 십진 숫자와 일치합니다; 이것은 클래스 ``[0-9]``
\\
와 동등합니다."
#:
../Doc/howto/regex.rst:134
msgid
"``
\\
D``"
msgstr
"``
\\
D``"
#:
../Doc/howto/regex.rst:134
msgid
""
"Matches any non-digit character; this is equivalent to the class "
"``[^0-9]``."
msgstr
"모든 비 숫자 문자와 일치합니다; 이것은 클래스 ``[^0-9]``
\\
와 동등합니다."
#:
../Doc/howto/regex.rst:138
msgid
"``
\\
s``"
msgstr
"``
\\
s``"
#:
../Doc/howto/regex.rst:137
msgid
""
"Matches any whitespace character; this is equivalent to the class ``[ "
"
\\
t
\\
n
\\
r
\\
f
\\
v]``."
msgstr
"모든 공백 문자와 일치합니다; 이것은 클래스 ``[
\\
t
\\
n
\\
r
\\
f
\\
v]`` 와 동등합니다."
#:
../Doc/howto/regex.rst:142
msgid
"``
\\
S``"
msgstr
"``
\\
S``"
#:
../Doc/howto/regex.rst:141
msgid
""
"Matches any non-whitespace character; this is equivalent to the class "
"``[^
\\
t
\\
n
\\
r
\\
f
\\
v]``."
msgstr
"모든 비 공백 문자와 일치합니다; 이것은 클래스 ``[^
\\
t
\\
n
\\
r
\\
f
\\
v]`` 와 동등합니다."
#:
../Doc/howto/regex.rst:146
msgid
"``
\\
w``"
msgstr
"``
\\
w``"
#:
../Doc/howto/regex.rst:145
msgid
""
"Matches any alphanumeric character; this is equivalent to the class "
"``[a-zA-Z0-9_]``."
msgstr
"모든 영숫자(alphanumeric character)와 일치합니다; 이것은 클래스 ``[a-zA-Z0-9_]``
\\
와 동등합니다."
#:
../Doc/howto/regex.rst:150
msgid
"``
\\
W``"
msgstr
"``
\\
W``"
#:
../Doc/howto/regex.rst:149
msgid
""
"Matches any non-alphanumeric character; this is equivalent to the class "
"``[^a-zA-Z0-9_]``."
msgstr
"모든 비 영숫자와 일치합니다; 이것은 클래스 ``[^a-zA-Z0-9_]``
\\
와 동등합니다."
#:
../Doc/howto/regex.rst:152
msgid
""
"These sequences can be included inside a character class. For example, "
"``[
\\
s,.]`` is a character class that will match any whitespace "
"character, or ``','`` or ``'.'``."
msgstr
""
"이 시퀀스들은 문자 클래스 내에 포함될 수 있습니다. 예를 들어, ``[
\\
s,.]`` 는 모든 공백 문자, ``','`` 또는 "
"``'.'``
\\
와 일치하는 문자 클래스입니다."
#:
../Doc/howto/regex.rst:156
msgid
""
"The final metacharacter in this section is ``.``. It matches anything "
"except a newline character, and there's an alternate mode "
"(:const:`re.DOTALL`) where it will match even a newline. ``.`` is often "
"used where you want to match
\"
any character
\"
."
msgstr
""
"이 절의 마지막 메타 문자는 ``.``
\\
입니다. 개행 문자를 제외한 모든 문자와 일치하며, 개행 문자와도 일치하는 대체 "
"모드(:const:`re.DOTALL`)가 있습니다. ``.`` 은
\"
모든 문자
\"
와 일치시키려고 할 때 자주 사용됩니다."
#:
../Doc/howto/regex.rst:163
msgid
"Repeating Things"
msgstr
"반복하기"
#:
../Doc/howto/regex.rst:165
msgid
""
"Being able to match varying sets of characters is the first thing regular"
" expressions can do that isn't already possible with the methods "
"available on strings. However, if that was the only additional "
"capability of regexes, they wouldn't be much of an advance. Another "
"capability is that you can specify that portions of the RE must be "
"repeated a certain number of times."
msgstr
""
"다양한 문자 집합을 일치시킬 수 있다는 것이 문자열에서 사용할 수 있는 메서드로 이미 가능하지 않은 것을 정규식이 수행할 수 있는 "
"첫 번째 것입니다. 그러나, 이것이 정규식의 유일한 추가 기능이라면, 그다지 진보했다고 할 수 없습니다. 또 다른 기능은 RE의 "
"일부가 특정 횟수만큼 반복되어야 한다고 지정할 수 있다는 것입니다."
#:
../Doc/howto/regex.rst:171
msgid
""
"The first metacharacter for repeating things that we'll look at is ``*``."
" ``*`` doesn't match the literal character ``'*'``; instead, it "
"specifies that the previous character can be matched zero or more times, "
"instead of exactly once."
msgstr
""
"우리가 살펴볼 반복을 위한 첫 번째 메타 문자는 ``*``
\\
입니다. ``*``
\\
는 리터럴 문자 ``'*'``
\\
와 일치하지 "
"않습니다; 대신 이전 문자를 정확히 한 번이 아닌 0번 이상 일치시킬 수 있도록 지정합니다."
#:
../Doc/howto/regex.rst:175
msgid
""
"For example, ``ca*t`` will match ``'ct'`` (0 ``'a'`` characters), "
"``'cat'`` (1 ``'a'``), ``'caaat'`` (3 ``'a'`` characters), and so forth."
msgstr
""
"예를 들어, ``ca*t``
\\
는 ``'ct'`` (0개의 ``'a'`` 문자), ``'cat'`` (1개의 ``'a'``), "
"``'caaat'`` (3개의 ``'a'`` 문자) 등과 일치합니다."
#:
../Doc/howto/regex.rst:178
msgid
""
"Repetitions such as ``*`` are :dfn:`greedy`; when repeating a RE, the "
"matching engine will try to repeat it as many times as possible. If later"
" portions of the pattern don't match, the matching engine will then back "
"up and try again with fewer repetitions."
msgstr
""
"``*``
\\
와 같은 반복은 :dfn:`탐욕스럽습니다 (greedy)`; RE를 반복할 때, 일치 엔진은 가능한 한 여러 번 "
"반복하려고 시도합니다. 패턴의 뒷부분이 일치하지 않으면, 일치 엔진은 되돌아가서 더 작은 반복으로 다시 시도합니다."
#:
../Doc/howto/regex.rst:183
msgid
""
"A step-by-step example will make this more obvious. Let's consider the "
"expression ``a[bcd]*b``. This matches the letter ``'a'``, zero or more "
"letters from the class ``[bcd]``, and finally ends with a ``'b'``. Now "
"imagine matching this RE against the string ``'abcbd'``."
msgstr
""
"단계별 예제를 통해 더 명확하게 알 수 있습니다. 정규식 ``a[bcd]*b``
\\
를 생각해 봅시다. 이 문자는 ``'a'`` "
"문자와 일치하고, 0개 이상의 ``[bcd]`` 클래스 문자가 뒤따르고, 마지막에 ``'b'``
\\
로 끝납니다. 이제 이 RE를 "
"문자열 ``'abcbd'``
\\
와 일치시킨다고 상상해보십시오."
#:
../Doc/howto/regex.rst:189
msgid
"Step"
msgstr
"단계"
#:
../Doc/howto/regex.rst:189
msgid
"Matched"
msgstr
"일치된 것"
#:
../Doc/howto/regex.rst:189
msgid
"Explanation"
msgstr
"설명"
#:
../Doc/howto/regex.rst:191
msgid
"1"
msgstr
"1"
#:
../Doc/howto/regex.rst:191
msgid
"``a``"
msgstr
"``a``"
#:
../Doc/howto/regex.rst:191
msgid
"The ``a`` in the RE matches."
msgstr
"RE의 ``a``
\\
가 일치합니다."
#:
../Doc/howto/regex.rst:193
msgid
"2"
msgstr
"2"
#:
../Doc/howto/regex.rst:193
msgid
"``abcbd``"
msgstr
"``abcbd``"
#:
../Doc/howto/regex.rst:193
msgid
""
"The engine matches ``[bcd]*``, going as far as it can, which is to the "
"end of the string."
msgstr
"엔진은 가능한 한 길게 ``[bcd]*``
\\
와 일치시키려고 문자열의 끝까지 갑니다."
#:
../Doc/howto/regex.rst:197
msgid
"3"
msgstr
"3"
#:
../Doc/howto/regex.rst:197
../Doc/howto/regex.rst:205
msgid
"*Failure*"
msgstr
"*실패*"
#:
../Doc/howto/regex.rst:197
msgid
""
"The engine tries to match ``b``, but the current position is at the end "
"of the string, so it fails."
msgstr
"엔진은 ``b``
\\
를 일치하려고 시도하지만, 현재 위치가 문자열의 끝이므로 실패합니다."
#:
../Doc/howto/regex.rst:202
msgid
"4"
msgstr
"4"
#:
../Doc/howto/regex.rst:202
../Doc/howto/regex.rst:213
msgid
"``abcb``"
msgstr
"``abcb``"
#:
../Doc/howto/regex.rst:202
msgid
"Back up, so that ``[bcd]*`` matches one less character."
msgstr
"물러서서, ``[bcd]*``
\\
가 하나 적은 문자와 일치합니다."
#:
../Doc/howto/regex.rst:205
msgid
"5"
msgstr
"5"
#:
../Doc/howto/regex.rst:205
msgid
""
"Try ``b`` again, but the current position is at the last character, which"
" is a ``'d'``."
msgstr
"``b``
\\
를 다시 시도하지만, 현재 위치는 ``'d'`` 인 마지막 문자에 있습니다."
#:
../Doc/howto/regex.rst:209
../Doc/howto/regex.rst:213
msgid
"6"
msgstr
"6"
#:
../Doc/howto/regex.rst:209
msgid
"``abc``"
msgstr
"``abc``"
#:
../Doc/howto/regex.rst:209
msgid
"Back up again, so that ``[bcd]*`` is only matching ``bc``."
msgstr
"다시 물러서서, ``[bcd]*``
\\
가 ``bc``
\\
하고 만 일치합니다."
#:
../Doc/howto/regex.rst:213
msgid
""
"Try ``b`` again. This time the character at the current position is "
"``'b'``, so it succeeds."
msgstr
"``b``
\\
를 다시 시도합니다. 이번에는 현재 위치의 문자가 ``'b'``
\\
이므로 성공합니다."
#:
../Doc/howto/regex.rst:219
msgid
""
"The end of the RE has now been reached, and it has matched ``'abcb'``. "
"This demonstrates how the matching engine goes as far as it can at first,"
" and if no match is found it will then progressively back up and retry "
"the rest of the RE again and again. It will back up until it has tried "
"zero matches for ``[bcd]*``, and if that subsequently fails, the engine "
"will conclude that the string doesn't match the RE at all."
msgstr
""
"RE의 끝에 도달했으며, ``'abcb'``
\\
와 일치했습니다. 이것은 일치 엔진이 처음에는 갈 수 있는 데까지 가본 다음, "
"일치하는 것이 발견되지 않으면 점진적으로 물러서고, 나머지 RE의 나머지 부분을 반복해서 다시 시도하는 것을 보여줍니다. "
"``[bcd]*``
\\
에 대한 일치 항목의 길이가 0이 될 때까지 물러서고, 그것마저도 실패하면, 엔진은 문자열이 RE와 전혀 "
"일치하지 않는다고 결론을 내립니다."
#:
../Doc/howto/regex.rst:226
msgid
""
"Another repeating metacharacter is ``+``, which matches one or more "
"times. Pay careful attention to the difference between ``*`` and ``+``; "
"``*`` matches *zero* or more times, so whatever's being repeated may not "
"be present at all, while ``+`` requires at least *one* occurrence. To "
"use a similar example, ``ca+t`` will match ``'cat'`` (1 ``'a'``), "
"``'caaat'`` (3 ``'a'``
\\
s), but won't match ``'ct'``."
msgstr
""
"또 다른 반복 메타 문자는 ``+``
\\
인 데, 하나 이상과 일치합니다. ``*``
\\
와 ``+``
\\
의 차이점에 주의하십시오; "
"``*``
\\
는 *0* 이상과 일치하므로, 반복되는 내용이 전혀 표시되지 않을 수 있습니다. 반면 ``+``
\\
는 적어도 "
"*1*
\\
번 이상 나타날 것을 요구합니다. 비슷한 예제를 사용하면, ``ca+t``
\\
는 ``'cat'`` (1 ``'a'``), "
"``'caaat'`` (3 ``'a'``)와 일치하지만 ``'ct'``
\\
와 일치하지는 않습니다."
#:
../Doc/howto/regex.rst:233
msgid
""
"There are two more repeating qualifiers. The question mark character, "
"``?``, matches either once or zero times; you can think of it as marking "
"something as being optional. For example, ``home-?brew`` matches either "
"``'homebrew'`` or ``'home-brew'``."
msgstr
""
"반복 한정자(qualifier)가 두 개 더 있습니다. 물음표 문자 ``?``
\\
는 한 번이나 0번 일치합니다; 무언가를 "
"선택적이라고 표시한다고 생각해도 좋습니다. 예를 들어, ``home-?brew``
\\
는 ``'homebrew'``
\\
나 "
"``'home-brew'``
\\
와 일치합니다."
#:
../Doc/howto/regex.rst:238
msgid
""
"The most complicated repeated qualifier is ``{m,n}``, where *m* and *n* "
"are decimal integers. This qualifier means there must be at least *m* "
"repetitions, and at most *n*. For example, ``a/{1,3}b`` will match "
"``'a/b'``, ``'a//b'``, and ``'a///b'``. It won't match ``'ab'``, which "
"has no slashes, or ``'a////b'``, which has four."
msgstr
""
"가장 복잡한 반복 한정자는 ``{m,n}``
\\
입니다. 여기서 *m*
\\
과 *n*
\\
은 십진수입니다. 이 한정자는 적어도 *m* "
"반복, 최대 *n* 반복이 있어야 함을 의미합니다. 예를 들어, ``a/{1,3}b``
\\
는 ``'a/b'``, ``'a//b'``"
" 및 ``'a///b'``
\\
와 일치합니다. ``'ab'``
\\
에는 슬래시가 없어서 일치하지 않고, ``'a////b'``
\\
에는 "
"4개 있어서 일치하지 않습니다."
#:
../Doc/howto/regex.rst:244
msgid
""
"You can omit either *m* or *n*; in that case, a reasonable value is "
"assumed for the missing value. Omitting *m* is interpreted as a lower "
"limit of 0, while omitting *n* results in an upper bound of infinity."
msgstr
""
"*m*
\\
이나 *n*
\\
을 생략 할 수 있습니다; 이때, 빠진 값에 대해 합리적인 값이 가정됩니다. *m*
\\
을 생략하면 0 "
"하한으로 해석하는 반면, *m*
\\
을 생략하면 무한대의 상한을 뜻합니다."
#:
../Doc/howto/regex.rst:248
msgid
""
"Readers of a reductionist bent may notice that the three other qualifiers"
" can all be expressed using this notation. ``{0,}`` is the same as "
"``*``, ``{1,}`` is equivalent to ``+``, and ``{0,1}`` is the same as "
"``?``. It's better to use ``*``, ``+``, or ``?`` when you can, simply "
"because they're shorter and easier to read."
msgstr
""
"환원주의로 기울어진 독자는 다른 세 한정자들을 이 표기법을 사용하여 표현할 수 있음을 알아챌 수 있을 겁니다. ``{0,}``
\\
은"
" ``*``
\\
와 같고, ``{1,}``
\\
은 ``+``
\\
와 같으며, ``{0,1}``
\\
은 ``?``
\\
와 같습니다. 그럴 수 "
"있다면 ``*``, ``+`` 또는 ``?``
\\
를 사용하는 것이 좋은데, 더 짧고 읽기 쉽기 때문입니다."
#:
../Doc/howto/regex.rst:256
msgid
"Using Regular Expressions"
msgstr
"정규식 사용하기"
#:
../Doc/howto/regex.rst:258
msgid
""
"Now that we've looked at some simple regular expressions, how do we "
"actually use them in Python? The :mod:`re` module provides an interface "
"to the regular expression engine, allowing you to compile REs into "
"objects and then perform matches with them."
msgstr
""
"이제 간단한 정규식을 살펴보았습니다. 실제로 파이썬에서 어떻게 사용해야 할까요? :mod:`re` 모듈은 정규식 엔진에 대한 "
"인터페이스를 제공해서, RE를 객체로 컴파일한 다음 일치를 수행 할 수 있도록 합니다."
#:
../Doc/howto/regex.rst:265
msgid
"Compiling Regular Expressions"
msgstr
"정규식 컴파일하기"
#:
../Doc/howto/regex.rst:267
msgid
""
"Regular expressions are compiled into pattern objects, which have methods"
" for various operations such as searching for pattern matches or "
"performing string substitutions. ::"
msgstr
""
"정규식은 패턴 객체로 컴파일되는데, 패턴 일치를 검색하거나 문자열 치환을 수행하는 등의 다양한 작업을 위한 메서드를 갖고 있습니다."
" ::"
#:
../Doc/howto/regex.rst:276
msgid
""
":func:`re.compile` also accepts an optional *flags* argument, used to "
"enable various special features and syntax variations. We'll go over the"
" available settings later, but for now a single example will do::"
msgstr
""
":func:`re.compile`
\\
은 다양한 특수 기능과 문법 변형을 가능하게 하는 선택적 *flags* 인자도 받아들입니다. "
"나중에 사용할 수 있는 설정을 살펴보도록 하겠지만, 지금은 한 가지 예 만 보겠습니다::"
#:
../Doc/howto/regex.rst:282
msgid
""
"The RE is passed to :func:`re.compile` as a string. REs are handled as "
"strings because regular expressions aren't part of the core Python "
"language, and no special syntax was created for expressing them. (There "
"are applications that don't need REs at all, so there's no need to bloat "
"the language specification by including them.) Instead, the :mod:`re` "
"module is simply a C extension module included with Python, just like the"
" :mod:`socket` or :mod:`zlib` modules."
msgstr
""
"RE는 문자열로 :func:`re.compile`
\\
에 전달됩니다. 정규식이 핵심 파이썬 언어의 일부가 아니고, 정규식을 표현하기 "
"위한 특수 문법이 만들어지지 않았기 때문에 RE는 문자열로 다뤄집니다. (RE를 전혀 필요로하지 않는 응용 프로그램이 있기 때문에,"
" 이를 포함해서 언어 사양을 부풀릴 필요가 없습니다.) 대신, :mod:`re` 모듈은 :mod:`socket`
\\
이나 "
":mod:`zlib` 모듈과 마찬가지로 파이썬에 포함된 C 확장 모듈일 뿐입니다."
#:
../Doc/howto/regex.rst:289
msgid
""
"Putting REs in strings keeps the Python language simpler, but has one "
"disadvantage which is the topic of the next section."
msgstr
"RE를 문자열에 넣는 것은 파이썬 언어가 더 간단하게 유지되도록 하지만, 다음 절의 주제인 한 가지 단점이 있습니다."
#:
../Doc/howto/regex.rst:296
msgid
"The Backslash Plague"
msgstr
"백 슬래시 전염병"
#:
../Doc/howto/regex.rst:298
msgid
""
"As stated earlier, regular expressions use the backslash character "
"(``'
\\
'``) to indicate special forms or to allow special characters to be"
" used without invoking their special meaning. This conflicts with "
"Python's usage of the same character for the same purpose in string "
"literals."
msgstr
""
"앞에서 언급한 것처럼, 정규식은 백 슬래시 문자(``'
\\
'``)를 사용하여 특수 형식을 나타내거나 특수 문자 특별한 의미를 갖지 "
"않고 사용되도록 합니다. 이것은 파이썬이 문자열 리터럴에서 같은 목적으로 같은 문자를 사용하는 것과 충돌합니다."
#:
../Doc/howto/regex.rst:303
msgid
""
"Let's say you want to write a RE that matches the string ``
\\
section``, "
"which might be found in a LaTeX file. To figure out what to write in the"
" program code, start with the desired string to be matched. Next, you "
"must escape any backslashes and other metacharacters by preceding them "
"with a backslash, resulting in the string ``
\\\\
section``. The resulting"
" string that must be passed to :func:`re.compile` must be "
"``
\\\\
section``. However, to express this as a Python string literal, "
"both backslashes must be escaped *again*."
msgstr
""
"LaTeX 파일에서 발견되는 문자열 ``
\\
section``
\\
과 일치하는 RE를 작성한다고 가정해 봅시다. 프로그램 코드에 무엇을"
" 쓸지 알아내기 위해, 일치시키고자 하는 문자열로 시작하십시오. 그런 다음, 백 슬래시와 다른 메타 문자 앞에 백 슬래시를 붙여 "
"이스케이프 처리하면, 문자열 ``
\\\\
section``
\\
을 얻게 됩니다. :func:`re.compile`
\\
에 전달되어야 하는"
" 결과 문자열은 ``
\\\\
section``
\\
이어야 합니다. 그러나, 이를 파이썬 문자열 리터럴로 표현하려면, 두 개의 백 "
"슬래시를 모두 *다시* 이스케이프 처리해야 합니다."
#:
../Doc/howto/regex.rst:312
msgid
"Characters"
msgstr
"문자"
#:
../Doc/howto/regex.rst:312
msgid
"Stage"
msgstr
"단계"
#:
../Doc/howto/regex.rst:314
msgid
"``
\\
section``"
msgstr
"``
\\
section``"
#:
../Doc/howto/regex.rst:314
msgid
"Text string to be matched"
msgstr
"일치시킬 텍스트 문자열"
#:
../Doc/howto/regex.rst:316
msgid
"``
\\\\
section``"
msgstr
"``
\\\\
section``"
#:
../Doc/howto/regex.rst:316
msgid
"Escaped backslash for :func:`re.compile`"
msgstr
":func:`re.compile`
\\
을 위해 이스케이프 처리된 백 슬래시"
#:
../Doc/howto/regex.rst:318
../Doc/howto/regex.rst:345
msgid
"``
\"\\\\\\\\
section
\"
``"
msgstr
"``
\"\\\\\\\\
section
\"
``"
#:
../Doc/howto/regex.rst:318
msgid
"Escaped backslashes for a string literal"
msgstr
"문자열 리터럴을 위해 이스케이프 처리된 백 슬래시"
#:
../Doc/howto/regex.rst:321
msgid
""
"In short, to match a literal backslash, one has to write ``'
\\\\\\\\
'`` "
"as the RE string, because the regular expression must be ``
\\\\
``, and "
"each backslash must be expressed as ``
\\\\
`` inside a regular Python "
"string literal. In REs that feature backslashes repeatedly, this leads "
"to lots of repeated backslashes and makes the resulting strings difficult"
" to understand."
msgstr
""
"즉, 리터럴 백 슬래시와 일치시키려면, RE 문자열로 ``'
\\\\\\\\
'``
\\
을 작성해야 하는데, 정규식은 "
"``
\\\\
``
\\
이어야하고, 일반 파이썬 문자열 리터럴 안에서 각 백 슬래시를 ``
\\\\
``
\\
로 표현해야 하기 때문입니다. 백"
" 슬래시를 반복적으로 사용하는 RE에서는, 수없이 반복되는 백 슬래시로 이어져, 결과 문자열을 이해하기 어렵게 만듭니다."
#:
../Doc/howto/regex.rst:327
msgid
""
"The solution is to use Python's raw string notation for regular "
"expressions; 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. Regular expressions will often be written in"
" Python code using this raw string notation."
msgstr
""
"해결책은 정규식에 파이썬의 날 문자열 표기법을 사용하는 것입니다; 백 슬래시는 ``'r'`` 접두사가 붙은 문자열 리터럴에서 특별한"
" 방법으로 처리되지 않아서, ``r
\"\\
n
\"
``
\\
는 ``'
\\
'``
\\
과 ``'n'``
\\
을 포함하는 두 문자 문자열이지만, "
"``
\"\\
n
\"
``
\\
는 줄 넘김을 포함하는 한 문자 문자열입니다. 정규식은 종종 이 날 문자열 표기법을 사용하여 파이썬 코드로 "
"작성됩니다."
#:
../Doc/howto/regex.rst:333
msgid
""
"In addition, special escape sequences that are valid in regular "
"expressions, but not valid as Python string literals, now result in a "
":exc:`DeprecationWarning` and will eventually become a "
":exc:`SyntaxError`, which means the sequences will be invalid if raw "
"string notation or escaping the backslashes isn't used."
msgstr
""
"또한, 정규식에서는 유효하지만, 파이썬 문자열 리터럴에서는 유효하지 않은 특수 이스케이프 시퀀스는 이제 "
":exc:`DeprecationWarning`
\\
을 발생시키고 결국에는 :exc:`SyntaxError`
\\
가 될 것입니다. 이는 "
"날 문자열 표기법이나 백 슬래시 이스케이핑이 사용되지 않으면 시퀀스가 유효하지 않게 됨을 뜻합니다."
#:
../Doc/howto/regex.rst:341
msgid
"Regular String"
msgstr
"일반 문자열"
#:
../Doc/howto/regex.rst:341
msgid
"Raw string"
msgstr
"날 문자열"
#:
../Doc/howto/regex.rst:343
msgid
"``
\"
ab*
\"
``"
msgstr
"``
\"
ab*
\"
``"
#:
../Doc/howto/regex.rst:343
msgid
"``r
\"
ab*
\"
``"
msgstr
"``r
\"
ab*
\"
``"
#:
../Doc/howto/regex.rst:345
msgid
"``r
\"\\\\
section
\"
``"
msgstr
"``r
\"\\\\
section
\"
``"
#:
../Doc/howto/regex.rst:347
msgid
"``
\"\\\\
w+
\\\\
s+
\\\\
1
\"
``"
msgstr
"``
\"\\\\
w+
\\\\
s+
\\\\
1
\"
``"
#:
../Doc/howto/regex.rst:347
msgid
"``r
\"\\
w+
\\
s+
\\
1
\"
``"
msgstr
"``r
\"\\
w+
\\
s+
\\
1
\"
``"
#:
../Doc/howto/regex.rst:352
msgid
"Performing Matches"
msgstr
"일치 수행하기"
#:
../Doc/howto/regex.rst:354
msgid
""
"Once you have an object representing a compiled regular expression, what "
"do you do with it? Pattern objects have several methods and attributes. "
"Only the most significant ones will be covered here; consult the "
":mod:`re` docs for a complete listing."
msgstr
""
"일단 컴파일된 정규식을 나타내는 객체가 있으면, 이것으로 무엇을 할까요? 패턴 객체에는 여러 가지 메서드와 어트리뷰트가 있습니다. "
"가장 중요한 것만 여기서 다루어집니다; 전체 목록을 보려면 :mod:`re` 설명서를 참조하십시오."
#:
../Doc/howto/regex.rst:360
../Doc/howto/regex.rst:418
#:
../Doc/howto/regex.rst:1064
msgid
"Method/Attribute"
msgstr
"메서드/어트리뷰트"
#:
../Doc/howto/regex.rst:360
../Doc/howto/regex.rst:418
#:
../Doc/howto/regex.rst:1064
msgid
"Purpose"
msgstr
"목적"
#:
../Doc/howto/regex.rst:362
msgid
"``match()``"
msgstr
"``match()``"
#:
../Doc/howto/regex.rst:362
msgid
"Determine if the RE matches at the beginning of the string."
msgstr
"문자열의 시작 부분에서 RE가 일치하는지 판단합니다."
#:
../Doc/howto/regex.rst:365
msgid
"``search()``"
msgstr
"``search()``"
#:
../Doc/howto/regex.rst:365
msgid
"Scan through a string, looking for any location where this RE matches."
msgstr
"이 RE가 일치하는 위치를 찾으면서, 문자열을 훑습니다."
#:
../Doc/howto/regex.rst:368
msgid
"``findall()``"
msgstr
"``findall()``"
#:
../Doc/howto/regex.rst:368
msgid
"Find all substrings where the RE matches, and returns them as a list."
msgstr
"RE가 일치하는 모든 부분 문자열을 찾아 리스트로 반환합니다."
#:
../Doc/howto/regex.rst:371
msgid
"``finditer()``"
msgstr
"``finditer()``"
#:
../Doc/howto/regex.rst:371
msgid
""
"Find all substrings where the RE matches, and returns them as an "
":term:`iterator`."
msgstr
"RE가 일치하는 모든 부분 문자열을 찾아 :term:`이터레이터 <iterator>`
\\
로 반환합니다."
#:
../Doc/howto/regex.rst:375
msgid
""
":meth:`~re.Pattern.match` and :meth:`~re.Pattern.search` return ``None`` "
"if no match can be found. If they're successful, a :ref:`match object "
"<match-objects>` instance is returned, containing information about the "
"match: where it starts and ends, the substring it matched, and more."
msgstr
""
":meth:`~re.Pattern.match`
\\
와 :meth:`~re.Pattern.search`
\\
는 일치하는 항목이 없으면 "
"``None``
\\
을 반환합니다. 성공하면, :ref:`일치 객체 <match-objects>` 인스턴스가 반환되고, 일치에 대한 "
"정보가 들어 있습니다: 어디에서 시작하고 끝나는지, 일치하는 부분 문자열 등입니다."
#:
../Doc/howto/regex.rst:380
msgid
""
"You can learn about this by interactively experimenting with the "
":mod:`re` module. If you have :mod:`tkinter` available, you may also "
"want to look at :source:`Tools/demo/redemo.py`, a demonstration program "
"included with the Python distribution. It allows you to enter REs and "
"strings, and displays whether the RE matches or fails. :file:`redemo.py` "
"can be quite useful when trying to debug a complicated RE."
msgstr
""
":mod:`re` 모듈로 대화식으로 실험해보면 알 수 있습니다. :mod:`tkinter`
\\
를 사용할 수 있다면, 파이썬 배포판에"
" 포함된 데모 프로그램인 :source:`Tools/demo/redemo.py`
\\
를 살펴볼 수도 있습니다. RE와 문자열을 "
"입력하면, RE가 일치하는지 실패하는지 표시합니다. :file:`redemo.py`
\\
는 복잡한 RE를 디버깅할 때 매우 유용 할 "
"수 있습니다."
#:
../Doc/howto/regex.rst:387
msgid
""
"This HOWTO uses the standard Python interpreter for its examples. First, "
"run the Python interpreter, import the :mod:`re` module, and compile a "
"RE::"
msgstr
""
"이 HOWTO는 예제에 표준 파이썬 인터프리터를 사용합니다. 먼저, 파이썬 인터프리터를 실행하고, :mod:`re` 모듈을 임포트 "
"한 다음, RE를 컴파일하십시오::"
#:
../Doc/howto/regex.rst:395
msgid
""
"Now, you can try matching various strings against the RE ``[a-z]+``. An "
"empty string shouldn't match at all, since ``+`` means 'one or more "
"repetitions'. :meth:`~re.Pattern.match` should return ``None`` in this "
"case, which will cause the interpreter to print no output. You can "
"explicitly print the result of :meth:`!match` to make this clear. ::"
msgstr
""
"이제, 다양한 문자열을 RE ``[a-z]+``
\\
와 일치시켜볼 수 있습니다. ``+``
\\
는 '하나 이상의 반복'을 의미하므로, "
"빈 문자열은 전혀 일치하지 않아야 합니다. 이때 :meth:`~re.Pattern.match`
\\
는 ``None``
\\
을 반환해야 "
"하며, 인터프리터는 출력을 인쇄하지 않습니다. 분명하게 하기 위해 :meth:`!match`
\\
의 결과를 명시적으로 인쇄 할 수 "
"있습니다. ::"
#:
../Doc/howto/regex.rst:405
msgid
""
"Now, let's try it on a string that it should match, such as ``tempo``. "
"In this case, :meth:`~re.Pattern.match` will return a :ref:`match object "
"<match-objects>`, so you should store the result in a variable for later "
"use. ::"
msgstr
""
"이제, 일치해야 하는 문자열을 시도해 봅시다, 가령 ``tempo``. 이때, :meth:`~re.Pattern.match`
\\
는 "
":ref:`일치 객체 <match-objects>`
\\
를 반환하므로, 나중에 사용할 수 있도록 결과를 변수에 저장해야 합니다. ::"
#:
../Doc/howto/regex.rst:413
msgid
""
"Now you can query the :ref:`match object <match-objects>` for information"
" about the matching string. Match object instances also have several "
"methods and attributes; the most important ones are:"
msgstr
""
"이제 :ref:`match object <match-objects>`
\\
를 조회하여 일치하는 문자열에 대한 정보를 얻을 수 "
"있습니다. 일치 객체 인스턴스에는 여러 메서드와 어트리뷰트가 있습니다; 가장 중요한 것들은 다음과 같습니다:"
#:
../Doc/howto/regex.rst:420
msgid
"``group()``"
msgstr
"``group()``"
#:
../Doc/howto/regex.rst:420
msgid
"Return the string matched by the RE"
msgstr
"RE와 일치하는 문자열을 반환합니다."
#:
../Doc/howto/regex.rst:422
msgid
"``start()``"
msgstr
"``start()``"
#:
../Doc/howto/regex.rst:422
msgid
"Return the starting position of the match"
msgstr
"일치의 시작 위치를 반환합니다"
#:
../Doc/howto/regex.rst:424
msgid
"``end()``"
msgstr
"``end()``"
#:
../Doc/howto/regex.rst:424
msgid
"Return the ending position of the match"
msgstr
"일치의 끝 위치를 반환합니다"
#:
../Doc/howto/regex.rst:426
msgid
"``span()``"
msgstr
"``span()``"
#:
../Doc/howto/regex.rst:426
msgid
"Return a tuple containing the (start, end) positions of the match"
msgstr
"일치의 (시작, 끝) 위치를 포함하는 튜플을 반환합니다."
#:
../Doc/howto/regex.rst:430
msgid
"Trying these methods will soon clarify their meaning::"
msgstr
"이 메서드를 실험해보면 곧 그 의미가 분명해질 것입니다::"
#:
../Doc/howto/regex.rst:439
msgid
""
":meth:`~re.Match.group` returns the substring that was matched by the RE."
" :meth:`~re.Match.start` and :meth:`~re.Match.end` return the starting "
"and ending index of the match. :meth:`~re.Match.span` returns both start "
"and end indexes in a single tuple. Since the :meth:`~re.Pattern.match` "
"method only checks if the RE matches at the start of a string, "
":meth:`!start` will always be zero. However, the "
":meth:`~re.Pattern.search` method of patterns scans through the string, "
"so the match may not start at zero in that case. ::"
msgstr
""
":meth:`~re.Match.group`
\\
은 RE에 의해 일치된 부분 문자열을 반환합니다. "
":meth:`~re.Match.start`
\\
와 :meth:`~re.Match.end`
\\
는 일치의 시작과 끝 인덱스를 반환합니다."
" :meth:`~re.Match.span`
\\
은 시작과 끝 인덱스를 단일 튜플로 반환합니다. "
":meth:`~re.Pattern.match` 메서드는 문자열의 시작 부분에서 RE가 일치하는지 검사하므로, "
":meth:`!start`
\\
는 항상 0입니다. 그러나, 패턴의 :meth:`~re.Pattern.search` 메서드는 문자열을 "
"훑기 때문에, 일치가 0에서 시작하지 않을 수 있습니다. ::"
#:
../Doc/howto/regex.rst:456
msgid
""
"In actual programs, the most common style is to store the :ref:`match "
"object <match-objects>` in a variable, and then check if it was ``None``."
" This usually looks like::"
msgstr
""
"실제 프로그램에서, 가장 일반적인 스타일은 :ref:`일치 객체 <match-objects>`
\\
를 변수에 저장한 다음, "
"``None``
\\
인지 확인하는 것입니다. 보통 이런 식입니다::"
#:
../Doc/howto/regex.rst:467
msgid
""
"Two pattern methods return all of the matches for a pattern. "
":meth:`~re.Pattern.findall` returns a list of matching strings::"
msgstr
""
"두 패턴 메서드는 패턴에 대한 모든 일치를 반환합니다. :meth:`~re.Pattern.findall`
\\
은 일치하는 문자열 "
"리스트를 반환합니다::"
#:
../Doc/howto/regex.rst:474
msgid
""
"The ``r`` prefix, making the literal a raw string literal, is needed in "
"this example because escape sequences in a normal
\"
cooked
\"
string "
"literal that are not recognized by Python, as opposed to regular "
"expressions, now result in a :exc:`DeprecationWarning` and will "
"eventually become a :exc:`SyntaxError`. See :ref:`the-backslash-plague`."
msgstr
""
"이 예제에서는 리터럴을 날 문자열 리터럴로 만드는 ``r`` 접두어가 필요한데, 일반적인
\"
요리된(cooked)
\"
문자열 "
"리터럴에 있는, 정규식에서는 허락되지만, 파이썬에서 인식하지 못하는, 이스케이프 시퀀스가 이제 "
":exc:`DeprecationWarning`
\\
을 발생시키고, 결국에는 결국 :exc:`SyntaxError`
\\
가 될 것이기 "
"때문입니다. :ref:`the-backslash-plague`
\\
를 참조하십시오."
#:
../Doc/howto/regex.rst:480
msgid
""
":meth:`~re.Pattern.findall` has to create the entire list before it can "
"be returned as the result. The :meth:`~re.Pattern.finditer` method "
"returns a sequence of :ref:`match object <match-objects>` instances as an"
" :term:`iterator`::"
msgstr
""
":meth:`~re.Pattern.findall`
\\
은 결과로 반환하기 전에 전체 리스트를 만들어야 합니다. "
":meth:`~re.Pattern.finditer` 메서드는 :ref:`매치 객체 <match-objects>` 인스턴스의 시퀀스를"
" :term:`이터레이터 <iterator>`
\\
로 반환합니다::"
#:
../Doc/howto/regex.rst:496
msgid
"Module-Level Functions"
msgstr
"모듈 수준 함수"
#:
../Doc/howto/regex.rst:498
msgid
""
"You don't have to create a pattern object and call its methods; the "
":mod:`re` module also provides top-level functions called "
":func:`~re.match`, :func:`~re.search`, :func:`~re.findall`, "
":func:`~re.sub`, and so forth. These functions take the same arguments "
"as the corresponding pattern method with the RE string added as the first"
" argument, and still return either ``None`` or a :ref:`match object "
"<match-objects>` instance. ::"
msgstr
""
"패턴 객체를 생성하고 메서드를 호출해야만 하는 것은 아닙니다; :mod:`re` 모듈은 :func:`~re.match`, "
":func:`~re.search`, :func:`~re.findall`, :func:`~re.sub` 등의 최상위 수준 함수도 "
"제공합니다. 이 함수들은 첫 번째 인자로 RE 문자열이 추가된 해당 패턴 메서드와 같은 인자를 취하고, 여전히 "
"``None``
\\
이나 :ref:`일치 객체 <match-objects>` 인스턴스를 반환합니다. ::"
#:
../Doc/howto/regex.rst:510
msgid
""
"Under the hood, these functions simply create a pattern object for you "
"and call the appropriate method on it. They also store the compiled "
"object in a cache, so future calls using the same RE won't need to parse "
"the pattern again and again."
msgstr
""
"내부적으로, 이 함수는 단순히 패턴 객체를 만들고 적절한 메서드를 호출합니다. 또한 컴파일된 객체를 캐시에 저장하므로, 같은 RE를"
" 사용하는 이후의 호출에서는 패턴을 반복해서 구문 분석할 필요가 없습니다."
#:
../Doc/howto/regex.rst:515
msgid
""
"Should you use these module-level functions, or should you get the "
"pattern and call its methods yourself? If you're accessing a regex "
"within a loop, pre-compiling it will save a few function calls. Outside "
"of loops, there's not much difference thanks to the internal cache."
msgstr
""
"이러한 모듈 수준의 함수를 사용해야 할까요, 아니면 패턴을 얻어서 메서드를 직접 호출해야 할까요? 루프 내에서 정규식에 액세스하고 "
"있다면, 사전 컴파일이 몇 번의 함수 호출을 절약할 수 있습니다. 루프 바깥에서는, 내부 캐시 덕분에 큰 차이가 없습니다."
#:
../Doc/howto/regex.rst:523
msgid
"Compilation Flags"
msgstr
"컴파일 플래그"
#:
../Doc/howto/regex.rst:525
msgid
""
"Compilation flags let you modify some aspects of how regular expressions "
"work. Flags are available in the :mod:`re` module under two names, a long"
" name such as :const:`IGNORECASE` and a short, one-letter form such as "
":const:`I`. (If you're familiar with Perl's pattern modifiers, the one-"
"letter forms use the same letters; the short form of :const:`re.VERBOSE` "
"is :const:`re.X`, for example.) Multiple flags can be specified by "
"bitwise OR-ing them; ``re.I | re.M`` sets both the :const:`I` and "
":const:`M` flags, for example."
msgstr
""
View remainder of file in raw view
Back
|
FazBrowse Home
|
New Git URL