Re: Regex for finding a '?' in a String



This regex :

"\\?"
should be enough

Regards,

Arnaud

<junk1@xxxxxxxxxxxxxxxx> a écrit dans le message de
news:1138719032.392933.6700@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Im trying to write a routine to replace the '?' in a String with values
> supplied by the client.
>
> ie
>
> String myString = "Hello there, my first name is ? and my surname is
> ?";
> String myRegex = "<a regex>";
> myString = myString.replaceFirst(myRegex, "David");
> myString = myString.replaceFirst(myRegex, "Bevan");
> System.out.println(mString);
>
>
> Required output is "Hello there, my first name is David and my surname
> is Bevan"
>
> What do i need as myRegex?
>
> Many thanks
>
> David Bevan
> http://www.davidbevan.co.uk
>


.