Jump to content

Match digits or characters


RobinTibbs

Recommended Posts

[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
Link to comment
https://forums.phpfreaks.com/topic/34978-match-digits-or-characters/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.