finding all numeric values from a string using Regex

  • Thread starter Thread starter Maersa
  • Start date Start date
M

Maersa

Hi All,

I'm new to RegEx and was wondering if somebody could show me how to extract
all of the numeric values from within a string....

string s = "3F 2F 1F"

I want to get the values "3" "2" and "1",

thanks in advance.
 
Hi,

Construct a regexp matching a sequence of digits like this:

[0-9]+

and then do Match followed by a number of NextMatch calls until NextMatch
returns null.
 
Back
Top