I'll have a pop...
^(F|K)[0-9]{4}(-[0-9]{1,2})?$
... any good?
Ade :OD
-----Original Message-----
From: Stephen Moretti (cfmaster) [mailto:[EMAIL PROTECTED]
Sent: 23 June 2004 13:14
To: [EMAIL PROTECTED]
Subject: Re: [ cf-dev ] OT: JS Regex
Mark Woods wrote:
>
>> ==================
>> For my sins - I have the following expressions that I need to compare
>> a string against in javascript.
>>
>> [F|K]([0-9]{4}) = F1234 or K1234
>
>
> try ^(F|K)[0-9]{4}$
Thanks for that Mark! Worked like a charm, however, I need to make an
amendment to the above expression.
I need to make this have an optional 3 characters on the end in the form
-99. In other words I need to write an expression that will match
F1234, F1234-, F1234-5 and F1234-56
At this point I'm all regex'd out. Any help would be appreciated.
Regards
Stephen
--
These lists are syncronised with the CFDeveloper forum at
http://forum.cfdeveloper.co.uk/
Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided
by activepdf.com*
*Forums provided by fusetalk.com* :: *ProWorkFlow provided by
proworkflow.com*
*Tutorials provided by helmguru.com* :: *Lists hosted by
gradwell.com*
To unsubscribe, e-mail: [EMAIL PROTECTED]
--
These lists are syncronised with the CFDeveloper forum at
http://forum.cfdeveloper.co.uk/
Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by
activepdf.com*
*Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com*
*Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com*
To unsubscribe, e-mail: [EMAIL PROTECTED]