Here '?!\s?not' after 'null' means 'null' is not
followed by zero/one whitespace followed by 'not'. So
the $+ will get 'null'.
but if u want 'null knot' then write
$str=~m/(null\s?knot)/
here the result will be 'null knot'
 --- RTO RTO <[EMAIL PROTECTED]> wrote: > Hello
Friends,
> 
> I am confused and hence coded a small RegEx
> statement.
> I am now having more questions. Would appreciate, if
> you can help:
> 
> Here is my code:
> 
> C:\>perl -e "$str = 'null knot';
> $str=~m/(null(?!\s?not))/; print $+;"
> 
> The Output is:
> null
> 
> Question 1: Should I not expect the full string
> 'null
> knot' to be printed? Why is just 'null' stored to
> the
> memory?
> 
> If the string is: $str = 'null not', there is no
> match
> according to my expectation. Fine.
> 
> Question 2: What would be my RegEx, if I want to
> say,
> "hey a string with TAT only if it is not preceded by
> a
> TIT"? I know that (?!<regex>) says, "match only if
> not
> followed by...". How would I do the opposite?
> 
> Thanks,
> Rex
> 
> 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Faith Hill - Exclusive Performances, Videos & More
> http://faith.yahoo.com
> 
> -- 
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>  

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to