I need to split a string on any of the following sequences:
1 or more spaces
0 or more spaces, followed by a comma, followed by 0 or more spaces,
0 or more spaces, followed by “=>”, followed by 0 or more spaces
Haven’t had experience doing Java regexs before, so I’m a little confused. Thanks!
Example:
add r10,r12 => r10
store r10 => r1
Just create regex matching any of your three cases and pass it into
splitmethod:Regex here means literally
\\s*)=>|,|\\s)\\s*)You can replace whitespace
\\s(detects spaces, tabs, line breaks, etc) with plain space characterif necessary.