Re: Easy Reg-Ex

2003-07-07 Thread Carl Jolley
On Fri, 4 Jul 2003, M Ajmal wrote: > Hi, > > I'm parsing a file and want to eliminate all lines > that start with "Test" and end with "PASS!". I'm > trying to do the following: > > /^Test.+PASS!$/ > > but it says no patterns match! > > Some help please. Show more code, please. [EMAIL PROTEC

RE: Easy Reg-Ex

2003-07-07 Thread Carl Jolley
On Fri, 4 Jul 2003, Beckett Richard-qswi266 wrote: > Isn't it because the ! hasn't been escaped with a \ that it doesn't work? > > That's what I thought, hence: > > /^Test.+PASS\!$/ > > This seems to work nicely. > - The ! is not a regex metacharacter so it doe

Re: Easy Reg-ex

2003-07-04 Thread M Ajmal
thanks for the help... I ended up solving the problem.. The reg-ex that worked was: /^Test.\+PASS!$/ For some reason, the "+" sign had to be escaped; yet, the "!" sign (which I thought for sure was something special) isnt'... :-) MA PS: It's amazing how much watching the reg-ex matching the pa

RE: Easy Reg-Ex

2003-07-04 Thread Beckett Richard-qswi266
This works for me... /^Test.*PASS\!$/ Use this little script to check out your pattern matches: while (<>) { chomp; if (/^Test.*PASS\!$/) { print "Matched: |$`<$&>'|\n"; } else { print "No match.\n"; } } R. > -Original Message

RE: Easy Reg-Ex

2003-07-04 Thread PAUL YBARRA
You may have a space at the begriming that is not obvious. Try cutting and pasting a line that contains an exact copy of a line you want to match into your code then slowly remove the specific characters replacing them with regular expressions to find your error. Respectfully, Paul > [Original