diff --git a/source/_posts/regex.md b/source/_posts/regex.md index 6c77a87..7a7c17e 100644 --- a/source/_posts/regex.md +++ b/source/_posts/regex.md @@ -338,13 +338,14 @@ Use `\` to search for these special characters:
`[ \ ^ $ . | ? * + ( ) { }` Order longer to shorter when alternatives overlap ### Character classes -| Pattern | Matches | -|---------------|--------------------------------------------------------------------| -| `[aeiou]` | Match any vowel | -| `[^aeiou]` | Match a NON vowel | -| `r[iau]ng` | Match ring, wrangle, sprung, etc. | -| `gr[ae]y` | Match gray or grey | -| `[a-zA-Z0-9]` | Match any letter or digit | +| Pattern | Matches | +|-------------------|--------------------------------------------------------------------| +| `[aeiou]` | Match any vowel | +| `[^aeiou]` | Match a NON vowel | +| `r[iau]ng` | Match ring, wrangle, sprung, etc. | +| `gr[ae]y` | Match gray or grey | +| `[a-zA-Z0-9]` | Match any letter or digit | +| `[\u3a00-\ufa99]` | Match any [Unicode Hàn (中文)](https://unicode.org/charts/unihan.html) | In `[ ]` always escape `. \ ]` and sometimes `^ - .`