On Mon, Jun 26, 2006 at 08:22:46AM -0700, Schultz, Eric wrote:
> I know what you mean, and I did something like that in my code that I
> backported from 3.5.x to 3.4.x.  I added another regex field that said
> whether something was mandatory or not, where 1 is mandatory, and 0 is
> not:
> 
> (?#Year)(?#0)^[12]\d{3}$            year, not mandatory
> (?#Mandatory)(?#1).                 anything, mandatory
> (?#postal code)(?#1)^[A-Z]{2}$      postal code, mandatory
> 
> The second one is useful for a field where you want anything, don't care
> how long or what it looks like, so long is it isn't left blank.
> Obviously, I hacked on the RT code a little that reads this stuff to
> accomodate for the second regex group.
> 
> Eric Schultz
> United Online

Eric,

Why add the second regex group when you can wrap the whole
thing in ()? ?

-Todd
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


We're hiring! Come hack Perl for Best Practical: 
http://bestpractical.com/about/jobs.html

Reply via email to