http://qs1969.pair.com?node_id=188379


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