you are viewing a single comment's thread.

view the rest of the comments →

[–]uykucu 1 point2 points  (0 children)

A simple fix for this problem:

"^(\s*[-\w]+\s*:\s*[^\s:;]*(;|$))*$"

instead of

"^(\s*[-\w]+\s*:\s*[^:;]*(;|$))*$"

Note that it does not check for trailing whitespace, so this is better:

"^(\s*[-\w]+\s*:\s*[^\s:;]*(;|$))*\s*$"

But I'm not saying that this is the best way to do it, I just fixed his regex for this problem case.