Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2017-11-21 01:40 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (294 votes). Check out past polls.