I need to get the text after the '?' sign, nut my regex doesn't work and I have java.lang.IllegalStateException: No match found
, so why is that and how to make it work?
import java.util.regex.Pattern;
class Test
{
public static void main(String[] args)
{
String rawString = "junk_text?precious_text";
String parsedString = Pattern.compile("\\?.+").matcher(rawString).group();
System.out.println(parsedString); // need to print precious_text
}
}