On Thu, 10 Apr 2014 10:05:44 -0300
luciano de souza <luchya...@gmail.com> wrote:

> Well, I need to study more. I can't understand what is wrong. The
> match starts with a blank space: \s+. Some string follows: .*. And it
> ends in the border of word: \b. So, (\s+.*\b)*, for me, should return:
> +ABC +DEF. If "@" is not present, why the rest of the string was
> matched.

The last (\s+@.*\b)* can be ignored, because of ()*.
The .* matches anything.
The \b matches any word border, for example the position behind 'Mary'.
So the (\s+\+.*\b) matches '+ABC +DEF @John @Mary'.

> [...]
> >> r.expression := '^(x\s+)*(\([A-E]\))*(\s*.*\.)+(\s+\+.*\b)*(\s+@.*\b)*$';
> >> if r.exec('x (A) Write a report. +ABC +DEF @John @Mary') then

Mattias
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to