Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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
Replies are listed 'Best First'.
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!

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2015-11-25 17:53 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (684 votes), past polls