in reply to Re: using && with regex in an if() statement
in thread using && with regex in an if() statement
Yes, the problem was the /g....I removed it and all was well.
I am trying to create a "natural language" parser, and a "real" sentence would have been something like
Fred bought the car
or
The car was bought by Fred
So I was searching for car and bought, but I thought /g would find the words globally through the text, regardless of position.
I apologize: I'm a real newbie with regular expressions; most of my Perl work has not involved any real searches to date, but that has now changed and I'm going through *that* chapter that I always kinda meant to get back to someday to figure out....
Thanks again!
Tacho