regex simple code example

Example 1: regex examples

a(b|c)     matches a string that has a followed by b or c (and captures b or c) -> Try it!a[bc]      same as previous, but without capturing b or c

Example 2: regex examples

\D         matches a single non-digit character -> Try it!

Example 3: regex examples

^The        matches any string that starts with The -> Try it!end$        matches a string that ends with end^The end$   exact string match (starts and ends with The end)roar        matches any string that has the text roar in it

Example 4: regex examples

<.+?>            matches any character one or more times included inside < and >, expanding as needed -> Try it!