> String s = "Hello?Friends";
> Pattern pattern =
> Pattern.compile("(?<=\\?)\\w+(?=\\b)");
>Matcher matcher = pattern.matcher(s);
> System.out.println(matcher.find() ? matcher.group()
> : "Nothing found.");
it looks complicated any easier way of doing it?
> > String s = "Hello?Friends";
> > Pattern pattern =
> > Pattern.compile("(?<=\\?)\\w+(?=\\b)");
> >Matcher matcher = pattern.matcher(s);
> > System.out.println(matcher.find() ?
> matcher.group()
> > : "Nothing found.");
>
> it looks complicated any easier way of doing it?
Ignore that! Prometheuzz is just showing off his mad regex skills, because someone told him it was medically proven to make your manhood bigger :-)
> > look at string tokenizer
>
> String tokenizer will not work here, since it will
> display all the values, before and after ?. i need
> only values after ?.
Only if you tell it to. StringTokenizer will be fine here, just don't iterate over it blindly pulling off all the values and using them
> ...
> Ignore that! Prometheuzz is just showing off his mad
> regex skills, because someone told him it was
> medically proven to make your manhood bigger :-)
Since I bought Friedl's book, my knowledge of the dark regex-force has grown several inches!
; )