正则表达式
- 匹配
- 组
- 取代
- 模式
- Classes Pattern and Matcher.
- Extracting matched expressions, Email Address Finder
- Backslashes in regular expressions
- Java regular expression syntax quick reference
- Regular expression Pattern class options
- Test Harness for Regex
- Catch PatternSyntaxException and get information from it
- Using a Non-Capturing Group in a Regular Expression
- Escaping Special Characters in a Pattern
- Adding Comments to a Regular Expression
- Using the Captured Text of a Group within a Pattern
- Setting Case Sensitivity in a Regular Expression
- Greedy and Nongreedy Matching in a Regular Expression
- Compiling a Pattern with Multiple Flags
- Capturing Text in a Group in a Regular Expression
- Use split method to split a string based on delimiters that match a regular expression
- Let a user enter the area code for a phone number with or without parentheses.
- | symbol defines an 'or' operation
- Reference group in regular expression
- Create regular expression for U.S. phone numbers with an optional area code
- Using parentheses to group characters
- Using escapes In regular expressions with a backslash
- ? quantifier create an optional element that may or may not be present in the string
- Duplicating elements rather than using a quantifier \d\d is \d{2}
- Matching multiple characters any times with Quantifiers
- What does \d\W[a-z] mean in regular expression
- Using negation in Regular expressions
- Use ranges to build a class that accepts only characters that appear in real words
- Create more than one range in a class
- Create ranges for pattern with [a-z]
- Create classes for the first and last characters so they too can be upper- or lowercase:
- Let the pattern include uppercase letters as well as lowercase letters
- Using custom character classes
- \w matches word character (a-z, A-Z, 0-9, or an underscore) and \W matches non word character
- Limit white space characters to actual spaces, just use a space in the regex.
- \S matches any character that isn't a white space character.
- \s class matches white space characters including spaces, tabs, newlines, returns, and backspaces.
- \D class matches any character that is not a digit.
- \d class represents a digit and use it to validate a U. S. Social Security number, XXX-XX-XXXX
- Using predefined character classes
- Use regex patterns to match a string literal exactly
- Removing accents and diacritics from given text .
- Compile a pattern that can will match a string if the string contains any of the given terms.
- Compile a pattern that can will match a string if the string starts with any of the given terms.
- Compile a pattern that can will match a string if the string equals any of the given terms.
- Regular Expression with Multiple Excludes
- 分割
- 词
- 电子邮件