I need to extract \"URPlus1_S2_3\"
from the string:
\"Last one: http://abc.imp/Basic2#URPlus1_S2_3,\"
using regular expressi
If you just want everything after the #
, use split:
String s = "Last one: http://abc.imp/Basic2#URPlus1_S2_3," ;
System.out.println(s.split("#")[1]);
Alternatively, if you want to parse the URI and get the fragment component you can do:
URI u = new URI("http://abc.imp/Basic2#URPlus1_S2_3,");
System.out.println(u.getFragment());