What I'm trying to achieve is to replace the numbers in the string with the new values computed from (match * int).
So the line input looks like this:
500g Flour
14g Salt
7g Dry yeast
45ml Olive oil
309ml Water
And the result should look like this:
1000g Flour
28g Salt
14g Dry yeast
90ml Olive oil
618 ml Water
row["ingredients"]is DataRow.
This is where I am located:
System.Text.RegularExpressions.
Regex.Replace(row["ingredients"].ToString(),
@"[^/d]", Delegate(Match match) { return match * 2; },
RegexOptions.Multiline);
Any solution is welcome.
James source
share