- Sep 19, 2000
- 10,284
- 138
- 106
I don't know why, but regular expressions just confuse me.
Anyways, here is what I need. I have to check a string that needs to contain two items. It will look something like this
"Blah: da da da wh FAIL"
or
"Blah: da SUCCESS wh fa"
I need to see if the string contains both Blah and FAIL or SUCCESS. The thing is, the why I'm getting these strings is in such a fashon that I could have multiple fails, successes, and blahs (I'm getting several lines like the above, think of reading something from dmsg in linux).
I've tried this, but it fails
/Blah:.*FAIL/
These are perl regular expressions by the way.
Anyways, here is what I need. I have to check a string that needs to contain two items. It will look something like this
"Blah: da da da wh FAIL"
or
"Blah: da SUCCESS wh fa"
I need to see if the string contains both Blah and FAIL or SUCCESS. The thing is, the why I'm getting these strings is in such a fashon that I could have multiple fails, successes, and blahs (I'm getting several lines like the above, think of reading something from dmsg in linux).
I've tried this, but it fails
/Blah:.*FAIL/
These are perl regular expressions by the way.