I need to extract a String between two {}. For example, .split(regex)
{Regex is difficult.}fadsfjkaslfdjsa{Humbug}asfasdfjaskdlfjlkaf
should return an array with Regex is difficult.
as the first entry and Humbug
as the second.
How would I write a regex to do this in Java?
I have tried the answers below, but I want to use myString.split(regex). I probably should have been more specific in my answer.
Should I even be using .split() for this or is there another way?