Cool, I wasn't aware of the \A \Z - I've always used ^ $

Like this:
<cfset var titleRegEx = "^(Dr|Prof|Mr|Mrs|Ms|Miss)(\.)?$" />

Edward A Savage Jr - "Sonny"
Senior Software Engineer
Creditdiscovery, LLC
"I believe in getting into hot water; it keeps you clean." ~ GK Chesterton


On Wed, Oct 15, 2008 at 2:58 PM, Richard White <[EMAIL PROTECTED]> wrote:

> Thanks Matt, i didn't think to use the \A and \Z as this was where i was
> getting lost, i couldn't understand how to constrain it just to those
> options, but your example works perfectly and i have learned something new
> :)
>
> thanks again
>
> richard
>
> >\b is an escape sequence that, as taken from the docs:
> >
> >"Specifies a boundary defined by a transition from an alphanumeric
> character
> >to a nonalphanumeric character, or from a nonalphanumeric character to an
> >alphanumeric character."
> >
> >Since you're passing in "Dr|", the pipe character matches, as it is a
> >transition from an alphanumeric character to a non-alphanumeric character.
> >
> >Assuming that you're wanting the title to be the only thing in the field,
> >with the exception of a possible period at the end, try something like
> this:
> >
> ><cfset var titleRegEx = "\A(Dr|Prof|Mr|Mrs|Ms|Miss)(\.)?\Z" />
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313955
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to