Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
regular_expression [2022/10/16 14:26] – Lookaround 내용 정리 ledyxregular_expression [2022/10/16 16:21] (current) – 문단 수정 ledyx
Line 168: Line 168:
  
  
 += 언어별 활용 =
  
-= Java =+== Java ==
  
 https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html
Line 179: Line 180:
 </sxh> </sxh>
  
-== Pattern Constant ==+=== Pattern Constant ===
  
 <sxh> <sxh>
Line 191: Line 192:
 </sxh> </sxh>
  
-== POSIX character classes (US-ASCII only) ==+=== POSIX character classes (US-ASCII only) ===
  
 <sxh> <sxh>
Line 207: Line 208:
 \p{XDigit} A hexadecimal digit: [0-9a-fA-F] \p{XDigit} A hexadecimal digit: [0-9a-fA-F]
 \p{Space} A whitespace character: [ \t\n\x0B\f\r] \p{Space} A whitespace character: [ \t\n\x0B\f\r]
-</sxh> 
-= 활용 = 
- 
-== 전화번호 == 
-<sxh java> 
-^(02|0[3-6]{1}[1-5]{1})-?[0-9]{3,4}-?[0-9]{4}$ //지역번호-xxx(x)-xxxx 
-^(15(44|77|88|99)|1644)-?[0-9]{4}$ //15xx/1644-xxxx 
-</sxh> 
- 
-== 소괄호 안 문자(= Parameter) 추출 == 
-<sxh java> 
-String str = "(int a, int b)"; 
- 
-Pattern p = Pattern.compile("\\((.*?)\\)"); 
-Matcher m = p.matcher(str); 
- 
-while(m.find()) 
- System.out.println(m.group(1)); 
 </sxh> </sxh>
  
regular_expression.1665926781.txt.gz · Last modified: 2022/10/16 14:26 by ledyx