Re: Best regex for this, getting software version numbers
Without testingL ^.*?($|\d+\.\d+) Which is, basically, beginning of string, shortest possible string, (end of string or digits dot digits). --Ben Doom Andy Matthews wrote: I have these strings: Firefox 2.0.0.8 (Firefox 2.0) Internet Explorer 7.0 (Internet Explorer 7.0) Googlebot 2.1 (Googlebot 2.1) Yahoo! Slurp (Yahoo! Slurp) etc. I'd like to grab everything up to a second period (if it exists). What I want is in parens next to each string. Anyone have any ideas? Andy Matthews Senior ColdFusion Developer Office: 877.707.5467 x747 Direct: 615.627.9747 Fax: 615.467.6249 [EMAIL PROTECTED] www.dealerskins.com http://www.dealerskins.com/ ~| Enterprise web applications, build robust, secure scalable apps today - Try it now ColdFusion Today ColdFusion 8 beta - Build next generation apps Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292096 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Best regex for this, getting software version numbers
I came up with this: ([a-zA-Z0-9 !]+).?([a-zA-Z0-9]+) Is there a better way to do this? -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Thursday, October 25, 2007 4:27 PM To: CF-Talk Subject: Best regex for this, getting software version numbers I have these strings: Firefox 2.0.0.8 (Firefox 2.0) Internet Explorer 7.0 (Internet Explorer 7.0) Googlebot 2.1 (Googlebot 2.1) Yahoo! Slurp (Yahoo! Slurp) etc. I'd like to grab everything up to a second period (if it exists). What I want is in parens next to each string. Anyone have any ideas? Andy Matthews Senior ColdFusion Developer Office: 877.707.5467 x747 Direct: 615.627.9747 Fax: 615.467.6249 [EMAIL PROTECTED] www.dealerskins.com http://www.dealerskins.com/ ~| Download the latest ColdFusion 8 utilities including Report Builder, plug-ins for Eclipse and Dreamweaver updates. http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292097 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4