A regular expression that matches everything after a specific character (like colon, word, question mark, etc.) in a string.
Can be used to replace or remove everything in the text that starts with a certain character.
Note that don’t forget to replace the FOO as displayed below.
/\FOO(.*)/g
Matches:
- FOOAbcdefg
- FOO1234567
- FOOABCDEFG
Non-matches:
- FOAbcdefg
- AFOObcdefg
- 1234567FOO
See Also:
- Regex To Match Anything After The First Space In A String
- Regex To Match The First Word After A Specific Word