Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^2: Regex help

by perlnoobster (Sexton)
on Dec 11, 2012 at 11:34 UTC ( #1008276=note: print w/ replies, xml ) Need Help??

in reply to Re: Regex help
in thread Regex help

Thank you everyone, all methods worked great :) I do have one slight niggle though, If the string contains the value AA1X32ALFC60JT8 then can this entire row including the /dp be excluded? e.g can -plastic-protector-AA1X32ALFC60JT8/dp/B00074658 be removed from the results? Thank you :)

Comment on Re^2: Regex help
Replies are listed 'Best First'.
Re^3: Regex help
by PetaMem (Priest) on Dec 11, 2012 at 11:46 UTC

    See the specific grep-map code in my other answer. For this requirement, you would simply add a negative match to the grep block:

    my @ids = grep { defined $_ && $_ !~ m{AA1X32ALFC60JT8} } map { match_ +id($_) } @lines_from_file;

        All Perl:   MT, NLP, NLU

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2015-11-26 00: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 (695 votes), past polls