masster:XiCheng, fill my knowledge plz.
What is the '?' stands for ? Because if i try your expression in Visual regEXP 3.0, it shows an error right at '?'.
I'm sure your expression is correct, but just to learn exactly, can i use this pattern in PHP as is?
Hi, I dont know which ? you were saying.
(?: ... ) is non-capturing
grouping construct
\s? means zero or one whitespace.
the pattern
^(?:[A-Z0-9'-.]+\s?)+(?<=\S)$ is
using Perl-compatible regex syntax. I dont know Visual regEXP 3.0's
regexes. If it's DFA regex, maybe you should change (?: ... ) to ( ...
) or \( ... \) to group
[A-Z0-9'-.]+ and
\s? together.
This pattern should work fine under PHP where you should use preg_match(...) instead of ereg_match(...).
Good luck,
Xicheng
perl -le 'print"So~*kde~box*DS*Zoxf*fe|er"^$\x23'