in reply to Not find a word / remove first char in string / remove last value in list

Another (distinctly Perlish) way to see if a word is not on a line, which is often more to-the-point than negative conditions is:

unless ($item =~ /foo/) {};

The best way to come to terms w/ regular expressions is to just experiment & play with them until they start to 'click' for you. Once you start to get them, then you can re-read the docs w/ at least half a clue about what they're talking about. Then you can move on to the more advanced materials.

Don't feel bad about having problems w/ regular expressions. There are thousands of experienced, high quality coders that regard them as weird, voodoo-like arcana. The fact that they're really a language-within-a-language can really throw coders.

Hanlon's Razor - "Never attribute to malice that which can be adequately explained by stupidity"
  • Comment on Re: Not find a word / remove first char in string / remove last value in list
  • Download Code