simon.proctor has asked for the wisdom of the Perl Monks concerning the following question:
The reason behind this is that most people I work with are techie enough to come up with input masks but not full regex. For example, its easier to do:MASK Purpose ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~ 0 Digit (0 to 9, entry required, plus [+] and minus [–] signs not a +llowed). 9 Digit or space (entry not required, plus and minus signs not allo +wed). # Digit or space (entry not required; plus and minus signs allowed) L Letter (A to Z, entry required). ? Letter (A to Z, entry optional)* A Letter or digit (entry required). a Letter or digit (entry optional)* & Any character or a space (entry required). C Any character or a space (entry optional)* . , : ; - / Literal character < Causes all characters to be converted to lowercase. > Causes all characters to be converted to uppercase. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * may remove this rule
Than to do(C##) ### ####### or (+00) 000 0000000
NB: I just wrote the regex out for an example, I have no idea if it works./^\(\+\d{2}\) \d{3} \d{7}$/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Inputmask based variable validation
by hardburn (Abbot) on Apr 02, 2004 at 20:13 UTC | |
by simon.proctor (Vicar) on Apr 02, 2004 at 20:19 UTC | |
by QM (Parson) on Apr 02, 2004 at 20:34 UTC | |
by simon.proctor (Vicar) on Apr 02, 2004 at 23:39 UTC | |
|
Re: Inputmask based variable validation
by Notromda (Pilgrim) on Apr 02, 2004 at 20:26 UTC | |
by simon.proctor (Vicar) on Apr 02, 2004 at 23:36 UTC |