Sorry for the bad title, but really could not find some other words for it. But, I am working in java and i have the following pattern matching to do.
The pattern is (\\w)*(\\s+)(\\w)*(\\,)(\\s*)(\\w)*(\\,)?(\\s*)(\\w)*
The String to be matched is of the type "add r0, r1, r2"
.
Now, how can I extract the all the individual strings from the above string, ie. add,r0,r1 and r2
?
To make it clearer, if the input string were "mov r1, r4"
, I would like to extract mov, r1 and r4.
How to go about this?