http://www.perlmonks.org?node_id=1214543


in reply to Re^3: check if string is valid with special cases
in thread check if string is valid with special cases

Ok I understand, forget about commas in the substrings.
your regex is good and its what I need except it doesn't handle an empty space case: "a,b,c, d,e" (bad case).
how can I add it to the regex?
  • Comment on Re^4: check if string is valid with special cases

Replies are listed 'Best First'.
Re^5: check if string is valid with special cases
by haukex (Archbishop) on May 15, 2018 at 11:17 UTC

    Again, more examples please. Only literal spaces? I am guessing you mean one or more spaces? What about other whitespace? Is " x ,..." valid? Is " x y ,..."? What is the expected output for those cases? And so on.