Continuing the discussion from Adding all values with same name together by using regex:
It is a bit complex, but I need to extract values from a long string in the following format:
Number 7 Amount:4,5 AA93 Number 6 Answer:No Number 8 Answer:Yes Number 5 Answer:No Number 3 Amount: 0,45 dollars Number 8 Answer:No Number 4 Amount:88 dollars AA92 Number 6 Answer:Yes Number 3 Amount: 1,42 Number 7 Amount:4,5 AA92 Number 6 Answer:Yes Number 3 Amount: 1,42 Number 7 Amount:4,5
As you can see, I need to extract the bold dollar value, by looking for the bold code (AA93).
In some cases, as you can see, there is a different code (for example AA92) and it this case i do not want to extract the amount related to Number three (the amount with emphasis).
What I am wondering is: is there any way to make a RegEx code with wildcards, so that I could use the following Regex-code, but implement wildcards for the answers to each “number”:
System.Text.RegularExpressions.Regex.Match(in_EntirePage,“(?<=AA93 Number 6 Answer:No Number 8 Answer:Yes Number 5 Answer:No Number 3 Amount:)\s*[0-9.,]*(?= dollars)”).Value
So wildcards for the Yes and No-answers previous to the amount