A regular expression describes one or more strings to match when you search a body of text. The expression serves as a template for matching a character pattern to the string that is being searched.A regular expression consists of ordinary characters (for example, letters a through z) and ...
{m,n}m to n Repetitions *Zero or more repetitions +One or more repetitions ?Optional character \sAny Whitespace \SAny Non-whitespace character ^…$Starts and ends (…)Capture Group (a(bc))Capture Sub-group (.*)Capture all (abc|def)Matches abc or def...
An example of regular expression using character class is SSN[0-9]+, which matches strings like SSN0, SSN1, and SSN12. Here, [0-9] is a character class and is allowed one or more times. The regular expression does not match SSN. An example of regular expression using capturing group...
A regular expression describes one or more strings to match when you search a body of text. The expression serves as a template for matching a character pattern to the string that is being searched. A regular expression consists of ordinary characters (for example, letters a through z) and ...
For more information, see Match zero or more times (lazy match). *? \w*?d matches "fad" and "ed" in "faded" but not the entire word "faded" due to the lazy match Match one or more occurrences of the preceding expression (match as few characters as possible). For more information...
A regular expression is a string that describes a search pattern. It defines one or more substrings to find in a text fragment. Regular expressions consist of: Literal symbols. Tokens that denote non-printable characters, digits, and alphanumeric characters Regular expression engine’s ...
<substitute>: A regex substitution expression to replace matches found in the input string. The <original> and <substitute> operands are subject to rules of the regular expression engine such as character escaping or substitution expressions. The replacement pattern can consist of one or more substi...
A regular expression is written in terms of literals that must be present -- such asa,b, orfish-- and certain functions that can be performed on these literals, such as repeating them one or more times. The functions are expressed by special characters, calledmetacharacters, that appear in ...
The expression does not match: abb One or More--Plus The one or more operator'+'matches one or more occurrences of the preceding expression. For example, to find one or more occurrences of the character 'a', you use the regular expression: ...
In this quick reference, learn to use regular expression patterns to match input text. A pattern has one or more character literals, operators, or constructs.