Need a little direction as to how to deal with something I want to do.
I’m trying to keep track of by banking transactions, and am not sure whether to use regex or replace sort of stuff.
I have a line in my downloaded transactions… and no, this isn’t real, just made up, but following the same syntax:
What would be the best way to handle something like this?
You can try
Var rx As New RegEx
rx.SearchPattern = "(?mi-Us)\/(.*)\/\/(.*)\/(.*)\/(.*)\/(.*)\/(.*)\/(.*)\/"
Var rxOptions As RegExOptions = rx.Options
rxOptions.LineEndType = 4
Var match As RegExMatch = rx.Search("/THETRANSACTION//START>DEBIT/AMOUNT/17522644.00/ENDAMOUNT/XOJOEARNINGS/ENDDESCRIPTION/")
While match IsA RegExMatch
// Do something
match = rx.Search // Fetch the next match
This will give you thee following results:
Or you can work with String.NthField.
How about string.Split("/")? The regex soln looks better and I suppose you’d still have to deal with the “//” and the > but its super easy