in reply to Extracting a String after a String within a String . . .

Regarding the first point, converting the case of a string using a regex is the hard way, just use uc or lc. To ignore case in a regex use the 'i' modifier.

To the second point, what you want is to capture characters that appear at a certain place in the string, and you can do this using parentheses. For example:

$aturl =~ /^http:\/\/$myuser(.*)$/i; # capture everything after the do +main $match = $1; # assign the captured stuff to a new variable.

See perlre for more explanation.


"The dead do not recognize context" -- Kai, Lexx

Replies are listed 'Best First'.
Re: Re: Extracting a String after a String within a String . . .
by rjahrman (Scribe) on May 29, 2003 at 01:16 UTC
    Thanks, that's just what I was looking for.