# Regex cheat sheet

Regular expressions or commonly called as Regex or Regexp is a tool which simplifies working with strings. It helps finding, filtering, repliacing and matching. This tool is essential to work efficiently with log files and in general working in IT. Sooner or later you will need it!

will match 5 in  Code 123, Price: $5, so it matches before it #### Negative lookbehind (?<!\$)\d+

will match 123 in Code 123, Price: \$5

# Flags

#### Global

/expression/g

by default, expression will find only first match, add g at the end to find all occurences

#### Multiline

/expression/m

handles each line separately

#### Case insensitive

/expression/i