This seems like a basic thing but i can't seem to get my head around regex's I've never really used them before and now i have come across a time they would be useful.
I've looked at examples and past questions for the last hour and still don't understand it. my problem is I have a string
"(2 h 9 min from now) | +18.7 feet"
which i want to split into two strings
String a = "2 h 9 min from now";
and
String b = "18.7 feet";
How can i split the string using a regex and use the 'regex's' in other strings?
so far i have come up with:
stringx.split("(%s) | +%s \n");
and
stringx.split("(\\w) | +\d.\d feet");
but i dont know how to get %s (if thats even right) into a string outside of the regex
splitwith regex pattern matching.