I am trying to find a regular expression to remove all words containing characters other than words.
So, if it contains a colon, comma, number, brackets, etc., then remove it from the string, not just the character, but the word. I still have it.
$wordline = s/\s.*\W.*?\s//g;
It’s not necessary to be perfect, so deleting lines with a dash and an apostrophe is fine.
source
share