in reply to Regex with two strings from files

Please let me know if you have enough info now

Please see SSCCE. As noted by haukex elsewhere today, "more != better". If your issue is with a regexp, please post code that shows the regexp, some sample input, and the desired output (in <code></code> tags). All the extra code here is unneeded and makes it harder to see what is going on, which reduces your chances of getting a speedy answer.

The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^2: Regex with two strings from files
by Anonymous Monk on Mar 01, 2017 at 02:36 UTC

    Noted on the more is NOT better and the positive suggestions. I guess it really is a simple regex question. How can I match a string that basically is a file path with a several /////s with a regex. Thanks again!

      c:\@Work\Perl\monks>perl -wMstrict -le "my $s = 'this is the path/to/my/file what i want'; ;; my $rx_ptf = qr{ \w+ (?: / \w+)+ }xms; ;; print qq{matched: '$1'} if $s =~ m{ \b ($rx_ptf) \b }xms; " matched: 'path/to/my/file'
      The  qr// m// s/// delimiters are (more or less) arbitrary. (Update: Please see Regexp Quote-Like Operators in perlop.)


      Give a man a fish:  <%-{-{-{-<