Gauss Posted October 23, 2014 Posted October 23, 2014 This is probably a silly Question but how can i get the digits extracted from a string and store it in an array of numbers For example: $str = 'Mark scored 95 out of 100 in the final test' Expected Result:95,100 I tried this: $num = StringRegExp($str, '(d+)', 2) but I'm getting the result as 95,95 Can someone please help me quickly?
jguinch Posted October 23, 2014 Posted October 23, 2014 Just replace 2 by 3 in the last parameter in your StringRegExp Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
Gauss Posted October 23, 2014 Author Posted October 23, 2014 1 more small question I sometimes get garbage value between these 2 number $str = 'Mark scored 95 out 08 of 100 in the final test' How to get the first and the last group of numbers?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now