http://qs321.pair.com?node_id=1207501


in reply to Re: regex is not working as I intended
in thread regex is not working as I intended

I'm not sure why,

At position 0,

  1. (?<=\')(.*?)(?>\') can't possibly match (there can't be a ' before the first character),
  2. (?<=\")(.*?)(?>\") can't possibly match (there can't be a " before the first character), but
  3. (.*) always matches.

Since it matched at position 0, it doesn't try to match at position 1 (where one of the first two alternates has a chance of matching).