Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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.

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 about the Monastery: (14)
As of 2016-10-24 15:02 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (307 votes). Check out past polls.