Fandom

Programmer's Wiki

Regular expression

410pages on
this wiki
Add New Page
Talk0 Share

Regular expressions are string expressions which are used to identify matching patterns in other strings. Many languages and environments implement regular expressions, often with small differences. Regular expressions first gained large-scale use on unix systems in conjunction with tools such as grep, awk, and sed.

Simple Examples Edit

Example 1. literal (no special characters used) Edit

hello


Matches the string "hello" only.


Example 2. any character. Edit

the "." character matches any character except newline (\n).

an.


Matches "an!", "and"

Example 3. zero-or-more characters. Edit

the "*" character matches any string zero or more of the character immediately preceding it.

hel*


Matches "hel", "hellll"

External Links Edit

See Also Edit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.