Thanks This worked for me .*TEXT:\s+".*?[\\\/]([^\\\/"]+)" | [reply] [d/l] |
somehow it is not working for me or am i doing something wrong :(
used it like this .*TEXT:\s+".*?[\/]([\/"]+)" as \\ was not recognized and for my input TEXT: "C:\temp\test äbc.txt" there were no matches found | [reply] [d/l] [select] |
You're missing the negation ^ in the character class. Also, you're using forward slashes in the regex, but backslashes in the string. Moreover, I'm not sure the ? is needed.
#! /usr/bin/perl
use strict;
use warnings;
use utf8;
my $input = 'TEXT: "C:\temp\test äbc.txt"';
print $input =~ /.*TEXT:\s+".*[\\]([^\\"]+)"/;
# ~ ~ ~ ~
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
| [reply] [d/l] [select] |