in reply to Re^5: Constructing a hash - why isn't my regex matching anything
in thread Constructing a hash - why isn't my regex matching anything

For the input line shown below,the regex is still no matching,I couldnt find anything wrong?Need your input

INPUT LINE:\root\edit\perl\scripts\scripths\sec\inc\script_auth_pap.h- +113115;perforcePLF.txt;//programfiles/documents/data/lookup/script_au +th_pap.h - label_scriptHS_source.01.16.00 : 5 if (my ($key, $value) = $line =~ /\.\\(.+?)-\d+;.+?;(.+?)\s-\s/) { }

Replies are listed 'Best First'.
Re^7: Constructing a hash - why isn't my regex matching anything
by Anonymous Monk on Dec 19, 2010 at 09:37 UTC
    Well, use re 'debug'; and YAPE::Regex::Explain and try to figure out why :)

    My guess, trial and error involves a lot of error *ZING* :D

    Seriously, this (unspecified format, formatted) input is looking more and more like CSV where the separator is a semi-colon, THUS, I would use Text::CSV//Text::xSV and be finished (hopefully).

    PS, FWIW, I'm fatigued, no more posts from me :)

Re^7: Constructing a hash - why isn't my regex matching anything
by Anonymous Monk on Dec 19, 2010 at 10:24 UTC
    I don't see a dot followed by a backslash in that string.