For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > January 2008 > Recover doesn't match regular expression









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Recover doesn't match regular expression
Ana

2008-01-23, 8:07 am

Hello People..
How I recover doesn't match regular expression???

I have one regular expression that return the match.. bu i would like
recover the doesn't macth
How?


Thanks

Chas. Owens

2008-01-23, 8:07 am

On Jan 23, 2008 6:38 AM, Ana <ana.travezani@gmail.com> wrote:
> Hello People..
> How I recover doesn't match regular expression???
>
> I have one regular expression that return the match.. bu i would like
> recover the doesn't macth
> How?

snip

If I understand you correctly, then all you need to do is expand the
regex to match the parts it didn't match before. So given /(bar)/ and
the string "foo bar baz" you will only capture "bar", but you can
expand the match to include "foo " and " baz" like this
/(.*)(bar)(.*)/. This behaves similarly to $`, $&, and $' without
their performance penalty being applied to every regex in your
program.
Paul Lalli

2008-01-23, 7:06 pm

On Jan 23, 6:38=A0am, ana.travez...@gmail.com (Ana) wrote:
> Hello People..
> How I recover doesn't match regular expression???
>
> I have one regular expression that return the match.. bu i would like
> recover the doesn't macth
> How?


English is obviously not your primary language. That's perfectly
fine. However, in that case, you should really try to speak Perl
rather than speak English.

Show an example of what you're trying to do. Show sample input and
desired output. Show whatever code you already have.

Your question, as worded, does not make any sense.

Paul Lalli

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com