in reply to Applying a regex to part of a string

Your second match doesn't work for the string "hello world ....hello world". It'll match the first "hello world" and decide it's out of bounds, without seeing the second "hello world" within the bounds.
  • Comment on Re: Applying a regex to part of a string

Replies are listed 'Best First'.
Re^2: Applying a regex to part of a string
by holdyourhorses (Monk) on Aug 19, 2005 at 07:23 UTC

    I knew that my second method looked fishy, and now I know why, because it's wrong! Good catch. Thanks.