Multiple words in any order using regex -


In the form of a title, I need to find two specific words in sentences. But they are in any order and in any cover You can. For example, I need to remove the term test and long term from the following sentence, for the word exam comes first or Long comes

  This is a very long sentence used as a test.  

Update: Not to mention that this case needs to be insensitive as well.

If you want to remove matches, then use a capturing group: (test). (Long) then depending on the language in use, you can refer to the matching group using $ 1 and $ 2, for example.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -