Regular expressions - metacharacters


  Translation results:

Regular Expression is a text pattern that includes ordinary characters (for example, letters between a and z) and special characters (called "metacharacters").

Regular expressions use a single string to describe and match a series of strings that match a certain syntax rule.

Regular expressions - metacharacterssyntax

Regular Expression is a text pattern that includes ordinary characters (for example, letters between a and z) and special characters (called "metacharacters").

Regular expressions use a single string to describe and match a series of strings that match a certain syntax rule.

Regular expressions - metacharactersexample

\Mark the next character as a special character, or a literal character, or a backward reference, or an octal escape character. For example, 'n' matches the character "n". '\n' matches a newline character. The sequence '\\' matches "\" and "\(" matches "(".
^Match the beginning of the input string. If the RegExp object is set Multiline attribute, ^ also matches the position after '\n' or '\r'.
$Match the end of the input string. If Multiline of the RegExp object is set Attribute, $ also matches the position before '\n' or '\r'.
*Matches the preceding subexpression zero or more times. For example, zo* Can match "z" and "zoo". * Equivalent to {0,}.
+Match the preceding subexpression one or more times. For example, 'zo+ ' can match "zo" and "zoo", but not "z". + Equivalent to {1,}.

Home

Videos

Q&A