in reply to Re: Re: Regex confusion
in thread Regex confusion

OK, to match those possible characters (and only those) try something like
m/((?:\w|\\\&|\-)*)\.((?:\w|\\\&|\-)*)/
the \w takes care of letters, numbers and _. I always escape the - out of habit but is unnecessary. The /i is redundant since the \w is case insensitive.
Personally I would do a nongreedy match. It will match other characters but it probably won't matter. Something like:
m/(.*?)\.(.*)/
update -- of course a simple split would do the trick.
my ($client, $project, $subproject) = split /\./, $x;

--

flounder

Replies are listed 'Best First'.
Re: Re:^3: Regex confusion
by neilwatson (Priest) on Aug 07, 2002 at 18:08 UTC
    update -- of course a simple split would do the trick.

    Neil bangs his head vigourously against his desk. Of course! Why the hell didn't I think of that before?

    Thank you all for your input.

    Neil Watson
    watson-wilson.ca