PtitePomme has asked for the wisdom of the Perl Monks concerning the following question:
Hi there! First, thanks for considering my query! I'm currently making a little script (obviously in Perl) and I'm trying to make a regex. My problem is that even if it works, something bothers me: I want to control this:
GigabitEthernet1/0/1with:
/(^gi.*)([1-8])(\/)(0)(\/)([1-9]|[1-3][0-9]|4[0-8])/iI want to make a regex which blocks the user if he inputs something like that:
GigabitEthernet1/0/49The maximum value of the number behind the last slash should be 48, but I cannot make. I don't want to make something like:
if ($6>48)....Could you help me please? Thanks in advance!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex : Limit value of a string
by hippo (Archbishop) on Oct 14, 2015 at 08:48 UTC | |
by PtitePomme (Initiate) on Oct 14, 2015 at 10:03 UTC | |
|
Re: Regex : Limit value of a string
by AppleFritter (Vicar) on Oct 14, 2015 at 09:29 UTC | |
|
Re: Regex : Limit value of a string
by LanX (Saint) on Oct 14, 2015 at 08:51 UTC | |
by locked_user sundialsvc4 (Abbot) on Oct 14, 2015 at 12:40 UTC | |
|
Re: Regex : Limit value of a string
by Athanasius (Archbishop) on Oct 14, 2015 at 09:57 UTC | |
|
Re: [SOLVED] Regex : Limit value of a string
by johngg (Canon) on Oct 14, 2015 at 14:46 UTC | |
|
Re: [SOLVED] Regex : Limit value of a string
by Discipulus (Canon) on Oct 14, 2015 at 10:43 UTC |