I can't figure out how to find a digit in a string like the following: Picture15.jpg. Does anyone have a RegEx of how to extract this digit in PHP?
Asked
Active
Viewed 1,058 times
-2
-
Have you gone through a basic tutorial for regular expressions? There's one at http://regular-expressions.info. – Andrew Cheong May 31 '13 at 05:14
-
What about `\\d+`?? `\d` is used to match digits. There are several other meaningful escape sequences which you should really go through first. – Rohit Jain May 31 '13 at 05:15
-
The regex itself would be /\d+/ but I don't have the PHP function syntax in mind. – rekire May 31 '13 at 05:16
-
I have done [code]\d[/code] but PHP only selects the first digit and then returns it. I don't know how to get all of the digits regardless of length... – Walter Cecil Worsley IV May 31 '13 at 05:21