in reply to Re: Puzzled by regex
in thread Puzzled by regex

This is not exactly accurate. \S+ greedily matches one or more non-space characters. \S+? non-greedily matches one or more non-space characters. The syntax does make sense.


Dave

Replies are listed 'Best First'.
Re^3: Puzzled by regex
by Loops (Curate) on Apr 10, 2013 at 06:48 UTC
    David,

    Thanks for correcting me. I was just dead wrong.

    It's explained here: Matching Repititions, Down a bit it explains, "minimal match or non-greedy quantifiers ?? , *? , +?, and {}?"

    Learn something new every day.

      Nothing to be ashamed of. ;) I often remind myself to leave regex-related questions alone because they're so hard to answer correctly.


      Dave