in reply to Re^2: search of a string in another string with 1 wildcard
in thread search of a string in another string with 1 wildcard
One way:
The construct [rdnfqm] defines a "character class". Please see perlre, perlrequick, and perlretut.c:\@Work\Perl>perl -wMstrict -le "my $string = 'abcdef'; ;; my $pattern = qr{ [rdnfqm] }xms; ;; print qq{matched '$1' at offset $-[1]} if $string =~ m{ ($pattern) }xms; " matched 'd' at offset 3
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: search of a string in another string with 1 wildcard
by carolw (Sexton) on Oct 12, 2014 at 16:57 UTC | |
by AnomalousMonk (Archbishop) on Oct 12, 2014 at 20:48 UTC | |
|
Re^4: search of a string in another string with 1 wildcard
by carolw (Sexton) on Oct 12, 2014 at 18:18 UTC | |
by AnomalousMonk (Archbishop) on Oct 12, 2014 at 20:57 UTC | |
by carolw (Sexton) on Oct 15, 2014 at 11:17 UTC | |
by AnomalousMonk (Archbishop) on Oct 15, 2014 at 14:58 UTC |