in reply to Regex confusion
I try that and get complete failure (the regex doesn't match at all).
That second grouping has some odd stuff going on in there; you start a character class, but have another one embedded inside it and it looks like you're also trying to use quantifiers in there, then you have an unescaped - which attempts to specify that you're seeking to match a range between what goes before and what goes after.
So let's step back one square: what kinds of things are you trying to match?
Presented with *this* example, I'd go much simpler and do:
if ( $x=~ /([^.]+)\.(\S+)/ ) { ... }
Unless those patterns are too forgiving ...
I mistrust all systematizers and avoid them. The will to a system shows a lack of integrity -- F. Nietzsche
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Regex confusion
by neilwatson (Priest) on Aug 07, 2002 at 16:54 UTC | |
by flounder99 (Friar) on Aug 07, 2002 at 17:22 UTC | |
by neilwatson (Priest) on Aug 07, 2002 at 18:08 UTC | |
by graff (Chancellor) on Aug 07, 2002 at 17:39 UTC |
In Section
Seekers of Perl Wisdom