I want to get 5/7/2018. I tried (?<=Net Cash)((\n.*){1}) which gives me this:
how can I start at the line 5/7/2018 and skip all the white space after Net Cash?
Is there a better way to get the data in the next line after finding the match?
I was thinking (?<=(Code$))((\n).*)
but it gives me the white space behind “Code” and 703-027 01 abc 5523 only
It does not always start with 703-027 01, that’s why I need to use Code to find the lines.
I am using regex101.com to test, could you please briefly explain the difference between Full Match, Group 1, Group 2?
See attached xaml example for reference. It does what you specified in the original post: ExtractingStrings.zip (2.3 KB)
Knowing how it goes, you will probably have to tune it a bit.
But the gist of the solution is to first split your string using .Split method and only then apply your Regex (if needed).
As to the questions, this code: (?<=(Code$))((\n).*)
produces those groups because anything you put between () is treated as a group. Try removing those groups like this:
(?<=Code$)\n.*
to see the difference and that they are gone.
Let me know if you have any questions. The code in my example might seem cryptic, but really isn’t and I would be happy to explain more if needed