Janek Schleicher wrote:
>
> John W. Krahn wrote at Tue, 20 Aug 2002 22:43:55 +0200:
> >
> > You can use \d instead of [0-9], \D instead of [^0-9] and \S instead of
> > [^\s].
> >
> > /^(\D+)(\d+ |)(\d+\/\S+)(.*)$/
> ^^^
>
> That's still an ugly and slow way to have an optional match
On 08/21, P lerenard said something like:
> Hi,
> why you dont use 2 split or 2 substr
> ethernet t and pos are letter the rest is number
> if you get the position of the last letter you just have to split the
> string, one for the string the rest for the details. That should be quicker.
the fir
On 08/21, Janek Schleicher said something like:
> John W. Krahn wrote at Tue, 20 Aug 2002 22:43:55 +0200:
>
> > Shawn wrote:
> > You can use \d instead of [0-9], \D instead of [^0-9] and \S instead of
> > [^\s].
> >
> > /^(\D+)(\d+ |)(\d+\/\S+)(.*)$/
> ^^^
>
> That's still an ugly
Hi,
why you dont use 2 split or 2 substr
ethernet t and pos are letter the rest is number
if you get the position of the last letter you just have to split the
string, one for the string the rest for the details. That should be quicker.
Pierre
>From: Shawn <[EMAIL PROTECTED]>
>To: [EMAIL PROT
bcc:Shawn Milochik/US/GODIVA/CSC
04:43 PM Subject: Re: Regex to split router
ifDescr up
Janek Schleicher wrote at Wed, 21 Aug 2002 00:45:57 +0200:
> m!^(\w+?) ?([\d/]+)$/ [untested]
^
Really untested, should be of course a !.
Cheerio,
Janek
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
John W. Krahn wrote at Tue, 20 Aug 2002 22:43:55 +0200:
> Shawn wrote:
>> I have two goals I would like help with:
>> 1. Optimize/simplify the regex
>> 2. Recognize where the regex would produce false positives on some
>> ifDescrs which don't actually have a real hardware path
More impo
Shawn wrote:
>
> So, I have an interesting question and a bit of code. I didn't really
> know whether this was the right forum or not, but here goes.
>
> I have two goals I would like help with:
> 1. Optimize/simplify the regex
> 2. Recognize where the regex would produce false positives on