From: Victor Cappuccio (cvictor@protokolgroup.com)
Date: Tue Sep 12 2006 - 12:56:40 ART
Hi Fabio,
You have to understand first what each character means.
http://www.cisco.com/univercd/cc/td/doc/product/software/ios122/122cgcr/fter
sv_c/ftsappx/tcfaapre.htm
For the first RE
^100(_[ 0-9]+)?$
Any thing that starts with 100 and ends with nothing more is matched
Since you have this ^100$ this is your regular expression
Now for (_[ 0-9]+)? That means is there (? = Yes or No) a match of ONE or
MORE digit between 0-9 (+ Sign) with a space
In this RE also the space is taking in consideration since you have the ()
and ?
So you could have something like
100
100 1
100 2 2
100 2 2 2
100 2 3
And so on.
For this RE ^100_[0-9]*$
The (*) matches ZERO or more sequences of the character, that is 992 or 2222
or 11111 or 3333333 or nothing. So you could have matches like
100
100 1
100 2
100 3
And nothing more
You can play around using public route servers like route-server.gt.ca
(telnet to that FQDN)
Saludos,
Victor.-
-----Mensaje original-----
De: nobody@groupstudy.com [mailto:nobody@groupstudy.com] En nombre de Fabio
Rodrigues
Enviado el: Martes, 12 de Septiembre de 2006 11:12 a.m.
Para: ccielab@groupstudy.com
Asunto: Regular Expressions
Hi All,
does anyone knows to say the difference of the effect (if exists) of these
two
regular expressions?
^100(_[ 0-9]+)?$
^100_[0-9]*$
Tks,
Fabio.
This archive was generated by hypermail 2.1.4 : Sun Oct 01 2006 - 16:55:40 ART