RE: ^54(_[0-9]+)?$ or ^54(_[0-9]+)*$ or something else

From: Guzman, Chris (Chris.Guzman@McKesson.com)
Date: Thu Aug 24 2006 - 21:09:52 ART


^54_[0-9]*$ would be the correct one.

The * matches 0 or more sequences of the atom.

The + matches 1 or more sequences of the atom.

So if you use +, in your expression it will not match the case of just
AS 54.

-----Original Message-----
From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf Of
CharlesB
Sent: Thursday, August 24, 2006 2:05 PM
To: ccielab@groupstudy.com
Subject: ^54(_[0-9]+)?$ or ^54(_[0-9]+)*$ or something else

Guys,

I am kind of confused between +,?,* regular expressions.

Let's say we are looking for AS 54 and its directly connected ASs:

1 ) For "54 X" , X is one digit or multiple

^54_[0-9]+$

or

^54_[0-9]*$

I think both will be matching.

2) For "54 X X X"

If directly connected customer's AS is prepending

^54(_[0-9]+)?$ will only match "54 X"

^54(_[0-9]+)*$ will match both "54 X" and "54 X X X", am I getting this
correctly?

I am looking for the expression best match for the "54 X X X", this is
the
question I have.

Thanks for any help in advance.



This archive was generated by hypermail 2.1.4 : Fri Sep 01 2006 - 15:41:58 ART