I have strings from a diff file that can occur in multiple ways:
'@@ -1289,4 +1289,4 @@'
'@@ -1289,2 +1289 @@'
'@@ -1289 +1289,8 @@'
I'd like to find a nice way to cover all possibilities using regex or other tools such that I can output lists as follows for each respective case
[1289,4,1289,4]
[1289,2,1289,0]
[1289,0,1289,8]
I have tried playing around with regex queries on this website
For example (-\d+,\d+) (\+\d+,\d+). However I'm not sure how to default to zero when it can't match a value. I am quite new to regex but I'm also starting to doubt if this is the tool that I need to be resorting to.
Any elegant ways to do this? Thanks
1289,4be a single string item or 2 integer items separated by,?