Re: Regex for finding a '?' in a String
- From: "Arnaud B." <toto@xxxxxxxx>
- Date: Tue, 31 Jan 2006 15:59:37 +0100
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
>
.
- References:
- Regex for finding a '?' in a String
- From: junk1
- Regex for finding a '?' in a String
- Prev by Date: Re: Regex for finding a '?' in a String
- Next by Date: Re: signum of long
- Previous by thread: Re: Regex for finding a '?' in a String
- Index(es):