When in doubt, I always recommend "Explain Regex" - there are many
such online services. Here is one.
http://rick.measham.id.au/paste/explain.pl?regex=%5Cd%2B(.%5Cd%2B)%3F(%5BeE%5D%5Cd%2B)%3F
Simply paste your regex in the box and click the button. It will then
analyse and explain what your
On Thu, 10 Apr 2014 10:05:44 -0300
luciano de souza 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 no
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.
My knowledge abou
On Thu, 10 Apr 2014 02:43:41 -0300
luciano de souza wrote:
>[...]
> r.expression := '^(x\s+)*(\([A-E]\))*(\s*.*\.)+(\s+\+.*\b)*(\s+@.*\b)*$';
> if r.exec('x (A) Write a report. +ABC +DEF @John @Mary') then
The (\s+\+.*\b) matches '+ABC +DEF @John @Mary'.
Mattias
Hello all,
This program compiles, but it gives a wrong output.
program ertext;
{$mode objfpc}{$H+}
uses
Sysutils, regexpr;
var
r: TRegexpr;
i: integer;
BEGIN
r := TRegexpr.create;
try
r.expression := '^(x\s+)*(\([A-E]\))*(\s*.*\.)+(\s+\+.*\b)*(\s+@.*\b)*$';
if r.exec('x (A) Write a report. +AB