Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Regexpression is not matching

by BrowserUk (Pope)
on Jun 05, 2013 at 14:22 UTC ( #1037236=note: print w/ replies, xml ) Need Help??


in reply to Regexpression is not matching

If you want to match that exactly line and nothing else and extract no date, don't use a regex. Use eq:

use constant THE_LINE => q[ Code (inc. data) RO Data RW Data + ZI Data Debug Object Name]; ... if( $MapFile->[ $iterator ] eq THE_LINE ) { ... }

As for why your regex doesn't match.

Did you chomp the newlines off when you read the lines in? Does the leading whitespace contain tabs perhaps? Or elsewhere in the line?


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re: Regexpression is not matching
Download Code
Re^2: Regexpression is not matching
by tobias_hofer (Friar) on Jun 05, 2013 at 14:29 UTC
    Thanks a lot! Yes, i have forgot to chomp the newline off and I will use equal instead of regex!

    Best regards!
    Tobias

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1037236]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2014-07-11 02:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (217 votes), past polls