in reply to Text Manipulation
# clean lines with words in $text =~ s/.*? # anything (?: # don't remember me (\w.*\w) # everything from first to last word charac +ter # on the line - remember this | # or [^\w\s]{6,} # at least 6 characters that aren't words o +r # spaces (in a row) - forget me ) .* # the rest of the line /$1/gx; # replace whole line with (\w.*\w) match, # if made.
Now, if your text contains puntuation, you might want to amend the (\w.*\w) match to take account of commas, etc that may appear at the end of a line:
if text contained only commas and periods.(\w.*\w) => ([\w\.,].*[\w\.,])
cLive ;-)
ps - IANAL (I am not a lecythis)
|
|---|