regex unexpected match of multiple chars in { brackets }
Posted: Mon Mar 07, 2011 5:52 pm
Consider these two lines of code:
$gamestatscache{$player}{$svariant}{wins} = 0;
$gamestatscache{$player}{$svariant}{losses} = 0;
In Textpad 5.4.2 I want to match the "$gamestatscache{$player}{" part which did not work. To simplify the problem I tried to match "$gamestatscache{$player" with:
REGEX 1: $gamestatscache{$[:alpha:]+
REGEX 1a: $gamestatscache{$\([:alpha:]\)+
Both
MATCH 1: $gamestatscache{$pla
which is wrong, correct match would be
MATCH 1b: $gamestatscache{$player
I tried to work around the problem with
REGEX 2: $gamestatscache{$[:alpha:]+yer
which matches (somewhat consequentially)
MATCH: $gamestatscache{$player
Seeing that, I tried to go for the full nine yards with
REGEX2: $gamestatscache{$[:alpha:]+yer}
which fails (no matches).
I am not sure if I got the syntax of Textpad's regex implementation right (I am mostly using perl regexes) but this looks like a bug to me.
Thank you for looking into this
from a rather happy registered & licensed user.
$gamestatscache{$player}{$svariant}{wins} = 0;
$gamestatscache{$player}{$svariant}{losses} = 0;
In Textpad 5.4.2 I want to match the "$gamestatscache{$player}{" part which did not work. To simplify the problem I tried to match "$gamestatscache{$player" with:
REGEX 1: $gamestatscache{$[:alpha:]+
REGEX 1a: $gamestatscache{$\([:alpha:]\)+
Both
MATCH 1: $gamestatscache{$pla
which is wrong, correct match would be
MATCH 1b: $gamestatscache{$player
I tried to work around the problem with
REGEX 2: $gamestatscache{$[:alpha:]+yer
which matches (somewhat consequentially)
MATCH: $gamestatscache{$player
Seeing that, I tried to go for the full nine yards with
REGEX2: $gamestatscache{$[:alpha:]+yer}
which fails (no matches).
I am not sure if I got the syntax of Textpad's regex implementation right (I am mostly using perl regexes) but this looks like a bug to me.
Thank you for looking into this
from a rather happy registered & licensed user.