This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| regular_expression [2022/10/16 13:26] – Lookaround 내용 정리 ledyx | regular_expression [2022/10/16 15:21] (current) – 문단 수정 ledyx | ||
|---|---|---|---|
| Line 168: | Line 168: | ||
| + | = 언어별 활용 = | ||
| - | = Java = | + | == Java == |
| https:// | https:// | ||
| Line 179: | Line 180: | ||
| </ | </ | ||
| - | == Pattern Constant == | + | === Pattern Constant |
| <sxh> | <sxh> | ||
| Line 191: | Line 192: | ||
| </ | </ | ||
| - | == 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 java> | ||
| - | ^(02|0[3-6]{1}[1-5]{1})-? | ||
| - | ^(15(44|77|88|99)|1644)-? | ||
| - | </ | ||
| - | |||
| - | == 소괄호 안 문자(= 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)); | ||
| </ | </ | ||