Regex find expression within text

I am quite bad at Regex but today I really need one to avoid the basic replace, the loops and the “if” everywhere.

I am looking for an expression in a full text that could get me this result:

nnLoremnntnrnIpsum ttt LoremtttHello Stackoverflow!
LoremrtnTest lorem ipsum V++ nrO+n

The result I am expecting is all the words except the ‘n’, ‘r’, ‘t’, I need the ‘Hello Stackoverflow’ at the end of the first sentence and also the V++ and the O+.

Is there any better way than removing the bad chars and extract the words via a easier regex? if yes how?

Thank you
Lenny


Source: regex

Leave a Reply