Regular Expressions

From Psygen Wiki
Revision as of 02:42, 23 December 2016 by Admin (talk | contribs)
Jump to navigation Jump to search

A regular expressions is a standard way of using text to form a search to match patterns.

Similar to using an asterisk like this: *.jpg in a search box to find all JPEG files, you can use a regular expression (along with something like grep) to match much more complex patterns.

For example, you could use:

\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b

to search for any e-mail addresses in a file

Cheat Sheet

References

  1. Ryan's Tutorials Grep and Regular Expressions
  2. Regular Expressions Info