|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] Problem with regular expression with XqueryDavid Lee dlee at calldei.comWed Feb 24 15:02:30 PST 2010
Try
[0-9]{3}\-[0-9]{3}(&P|P)?
----------------------------------------------------
David A. Lee
http://x-query.com/mailman/listinfo/talk
http://www.calldei.com
http://www.xmlsh.org
From: Kenneth Dougherty
Sent: Wednesday, February 24, 2010 2:52 PM
To: http://x-query.com/mailman/listinfo/talk
Subject: Problem with regular expression with Xquery
Hello,
The following problem has me stumped, and I would be grateful for any help.
I am using a regular expression to test if a document number is correct. The number can end with either 'P,' '&P,' or it may not have an ending value outside of the regular number.
For example, if a valid document number was 503-302, it could be 503-302P, 503-302&P, or just 503-302.
The incorrect regular expression so far is: [0-9]{3}\-[0-9]{3}&P|P.
This expression correctly finds 503-302P and 503-302&P, but of course fails to find 503-302. I've tried putting in other 'or' conditions at the end [e.g., |\s], but nothing has worked out.
Thank you again for your time and help.
Sincerely,
Kenneth Dougherty
--------------------------------------------------------------------------------
_______________________________________________
http://x-query.com/mailman/listinfo/talk
http://x-query.com/mailman/listinfo/talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://x-query.com/pipermail/talk/attachments/20100224/85cc379b/attachment.htm
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








