Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm wondering why my regex only matches the first half of my expression and ignores my 'or' using the following line:
I'm obviously missing something here.
Thanks
If 'ifSpeed' is seen then the index is found but $2 is set if the second format is seen.if (/^ifSpeed.(\d+)|^1.3.6.1.2.1.2.2.1.5.(\d+)/){ print "Index: $1\n"; }
I'm obviously missing something here.
Thanks
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: regex question/mystery
by brian_d_foy (Abbot) on Jan 17, 2006 at 18:39 UTC | |
by Anonymous Monk on Jan 17, 2006 at 18:45 UTC | |
Re: regex question/mystery
by Tanktalus (Canon) on Jan 17, 2006 at 18:41 UTC | |
Re: regex question/mystery
by imagestrips (Initiate) on Jan 17, 2006 at 18:44 UTC | |
Re: regex question/mystery
by blazar (Canon) on Jan 17, 2006 at 18:40 UTC | |
Re: regex question/mystery
by philcrow (Priest) on Jan 17, 2006 at 18:37 UTC | |
by davido (Cardinal) on Jan 17, 2006 at 18:58 UTC |
Back to
Seekers of Perl Wisdom