Re: grouppin in the regular expressions

2006-10-15 Thread I . B .
right, what was i thinking? thank you. On 10/13/06, John W. Krahn <[EMAIL PROTECTED]> wrote: I.B. wrote: > sorry, I didn't fraze my question correctly. ^ phrase > example : > $line="abcxabcxxabcxxxabc"; > > how to match everything beofre "xxx" but not xx

Re: grouppin in the regular expressions

2006-10-13 Thread John W. Krahn
I.B. wrote: > sorry, I didn't fraze my question correctly. ^ phrase > example : > $line="abcxabcxxabcxxxabc"; > > how to match everything beofre "xxx" but not xxx itself? > the answer i got is to use lookaheads: > > my $line = "abcxxabcxxxabc"; > if ($line =

Re: grouppin in the regular expressions

2006-10-13 Thread I . B .
sorry, I didn't fraze my question correctly. example : $line="abcxabcxxabcxxxabc"; how to match everything beofre "xxx" but not xxx itself? the answer i got is to use lookaheads: my $line = "abcxxabcxxxabc"; if ($line =~ m{(.*?(?:(?!xxx).))xxx}){ print "matched: $1\n"; } else{ print "f

Re: grouppin in the regular expressions

2006-10-13 Thread John W. Krahn
I.B. wrote: > Hi nice people, Hello, > how to specify using regular expressions: match everything but string (xxx) > > i would do this : > > $line =~ /[^(xxx)]+/; > > but, as it was mentioned before () inside character class is not working. > what is solution here? Perhaps you want: $line !~

RE: grouppin in the regular expressions

2006-10-13 Thread Wagner, David --- Senior Programmer Analyst --- WGO
use !~ vs =~ which is if not so if ( $line !~ /\(xxx\)/ ) { # does not contain (xxx) }else { # does contain } If you have any problems or questions, please let me know. Thanks. Wags ;) David R Wagner Senior Program