Sunday 15 January 2012

regex - What is the special character / escape for "whitespace" in a POSIX extented regular expression? -



regex - What is the special character / escape for "whitespace" in a POSIX extented regular expression? -

i new regular exp concept. trying utilize reg ex

[^@\s]+$

if give string "abs", actulally excluding character 's' . means '\s' read character 's' rather whitespace. please help me solve problem

you can utilize posix equivalent:

^[^@[:space:]]+$

[:space:] matches whitespace including newline. if want avoid matching newlines use: [:blank:] instead.

regex posix-ere

No comments:

Post a Comment