in reply to pattern matching whitespace

in general, if it's unknown number, you can can use the ? or {} modifiers.. for example, any of the following would catch 1 or two spaces:
/( | )/ / ?/ / {1,2}/
Where x? matchs 0 or 1 x, and x{n,m} matches between n and m x's, inclusive. A couple general comments.. -- it's more robust (maybe not necessary for your task) to not use just a "." when the posible characters are known. for example, match "/20\d\d/" instead of "/200../" and "/^a-zA-Z{3} /" instead of "/^..../" (or even "/^(?:Mon|Tue) /" type of thing).

Replies are listed 'Best First'.
Re^2: pattern matching whitespace
by tcf03 (Deacon) on Apr 13, 2005 at 17:25 UTC
    using /( |  )/ seems to do the trick. I don't know why I was hung up on using /..?/ or /.+/

    Thanks
    Ted
      The problem was that you used /..+/, which means "two or more", not "one or more" or "one or two".