in reply to Regex with Backslashes
Your problem is confusing single quotes and double quotes.
'\,' is exactly equal to '\\,' and so is "\\,"
$text = '1,This is a problem->\\,B,2';
is correct and should not split at the '\\,' (which is exactly equal to '\,')my $regex = qr/(?<!\\),|(?<=\\\\),/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex with Backslashes
by anita2R (Scribe) on May 17, 2020 at 18:57 UTC | |
by tybalt89 (Monsignor) on May 17, 2020 at 19:35 UTC | |
by anita2R (Scribe) on May 17, 2020 at 20:45 UTC | |
by tybalt89 (Monsignor) on May 18, 2020 at 00:20 UTC | |
by anita2R (Scribe) on May 18, 2020 at 19:17 UTC | |
by AnomalousMonk (Archbishop) on May 17, 2020 at 21:17 UTC | |
by anita2R (Scribe) on May 17, 2020 at 22:38 UTC | |
|