in reply to Re^10: Recursive search
in thread Recursive search

I actually dont want to use \w ,would it be possible for you to suggest soemthing generic ,meaning ,whatever is present betwen the last "/" and .plf should match including the .plf

INPUT: //tools/scripts/script_rev1.1.plf //tools/scripts/fil&es_data.plf

OUTPUT: script_rev1.1.plf fil&es_data.plf

Replies are listed 'Best First'.
Re^12: Recursive search
by poj (Abbot) on Dec 17, 2010 at 23:02 UTC

    You nearly had it right before with .+, try this

    if ($line =~ /\/(.+\.plf$)/)
    poj
Re^12: Recursive search
by Anonyrnous Monk (Hermit) on Dec 17, 2010 at 23:18 UTC

    As file names can contain anything but a slash, match anything but a slash - i.e. [^/]+ - between the last directory separator and .plf:

    if ($line =~ m|/([^/]+\.plf$)|) {

      doesn't seem to work with $ at the end

        you don't say :)