program Project1;
{$mode objfpc}{$H+}
Uses Sysutils, Classes, regexpr;
Var
r:TRegExpr;
b:Boolean;
begin
r:=TRegexpr.Create;
r.Expression:='\/[a-z]{3}\/';
r.ModifierG:=True;
r.ModifierI:=True;
r.ModifierM:=True;
r.InputString:='AA/ABC/222';
b:=r.Exec;
IF b Then Writeln('Found') Else Writeln('not found');
Readln;
end.
Writes "Found"
Conclusion: Leave out the Tildes, and set the Modifiers as shown
EDIT:
I could circumvent the "i" and "m" Modifiers, but haven't found how to avoid the "g"-Modifier
program Project1;
{$mode objfpc}{$H+}
Uses Sysutils, Classes, regexpr;
Var
r:TRegExpr;
b:Boolean;
begin
r:=TRegexpr.Create;
r.Expression:='(?i)(?m)\/[a-z]{3}\/';
r.ModifierG:=True;
//r.ModifierI:=True;
//r.ModifierM:=True;
r.InputString:='AA/ABC/222';
b:=r.Exec;
IF b Then Writeln('Found') Else Writeln('not found');
Readln;
end.
Returns "Found"
EDIT2: re "g"-Modifier
Seems there is no "Pattern"-Modifier for "g".
It's just the difference finding the first Match, or going through a loop finding all
OTOH, i wouldn't know whats sense it makes to find all occurences IN ONE GO in a spreadsheet.
It's always been "stop after first match", and "continue search" if it's not the match you are looking for