RobinTibbs Posted January 20, 2007 Share Posted January 20, 2007 [code]%($browser)[ /]([\d.]+[\w.]+)%[/code]the intention of this pattern is to get the browser name and version number. now it works fine when the version number has just numbers and periods, but if there are letters (perhaps to designate beta versions) then the pattern doesnt get the version number correctly. so im looking for a way to modify [b]this[/b] [code]([\d.]+[\w.]+)[/code] part of the pattern so it will capture any version number with just numbers and periods + any version with numbers, dots and letters. many thanks Quote Link to comment https://forums.phpfreaks.com/topic/34978-match-digits-or-characters/ Share on other sites More sharing options...
Orio Posted January 20, 2007 Share Posted January 20, 2007 Try this...[code][a-zA-Z0-9\.]+[/code]Orio. Quote Link to comment https://forums.phpfreaks.com/topic/34978-match-digits-or-characters/#findComment-164998 Share on other sites More sharing options...
RobinTibbs Posted January 20, 2007 Author Share Posted January 20, 2007 ah perfect! thanks! i tried something similar but that wasn't quite it :) Quote Link to comment https://forums.phpfreaks.com/topic/34978-match-digits-or-characters/#findComment-165008 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.