in reply to Re: Regex help \b & \Q
in thread Regex help \b & \Q
It seems there is a problem.
when we give $kw = 'C++'; or $kw = 'C'; it fails to show the correct answer.
Consider the below scenario,
my $kw = 'C'; # or use C++ my $title = ".net C .NET Cobol .NET C++ .NET .NETER Perl IT x.NET .net +"; my $count = () = $title =~ m{ (?<! \S) \Q$kw\E \b }xmsig; print $count; die;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Regex help \b & \Q
by AnomalousMonk (Archbishop) on Apr 14, 2016 at 11:45 UTC | |
by Anonymous Monk on Apr 14, 2016 at 12:17 UTC | |
by ikegami (Patriarch) on Apr 14, 2016 at 18:29 UTC | |
by AnomalousMonk (Archbishop) on Apr 14, 2016 at 19:43 UTC | |
by rsFalse (Chaplain) on Apr 14, 2016 at 20:07 UTC | |
by AnomalousMonk (Archbishop) on Apr 14, 2016 at 20:51 UTC | |
| |
by AnomalousMonk (Archbishop) on Apr 14, 2016 at 12:43 UTC | |
|
Re^3: Regex help \b & \Q (updated)
by haukex (Archbishop) on Apr 14, 2016 at 11:14 UTC | |
by AnomalousMonk (Archbishop) on Apr 14, 2016 at 11:58 UTC | |
by Anonymous Monk on Apr 14, 2016 at 12:11 UTC |