regex
5 tutorials tagged “regex”.
- Regular Expressions in JavaSearch text by pattern instead of exact words: Pattern and Matcher, find vs matches, positions and results, and why patterns are compiled once.
- Regex Groups and Named GroupsCapture parts of a match with parentheses: numbered and named groups, reusing them in replacements, non-capturing groups and back-references.
- Regex with String MethodsUse regex straight from String: matches, split, replaceAll and replaceFirst, their surprises with dots and dollar signs, and when to precompile.
- Regex Character Classes, Quantifiers and MetacharactersThe building blocks of a pattern: character classes, shortcuts like \\d and \\w, quantifiers, anchors, escaping, and greedy vs lazy matching.
- Validating Input with RegexReal validators for email, Indian phone numbers and strong passwords, a log-line parser with named groups, and how one bad pattern can freeze a server.