what is a regex examples

Example 1: 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 2: regex examples

abc*        matches a string that has ab followed by zero or more c -> Try it!abc+        matches a string that has ab followed by one or more cabc?        matches a string that has ab followed by zero or one cabc{2}      matches a string that has ab followed by 2 cabc{2,}     matches a string that has ab followed by 2 or more cabc{2,5}    matches a string that has ab followed by 2 up to 5 ca(bc)*      matches a string that has a followed by zero or more copies of the sequence bca(bc){2,5}  matches a string that has a followed by 2 up to 5 copies of the sequence bc

Tags:

R Example