Regex for finding a '?' in a String
- From: junk1@xxxxxxxxxxxxxxxx
- Date: 31 Jan 2006 06:50:32 -0800
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
.
- Follow-Ups:
- Re: Regex for finding a '?' in a String
- From: Arnaud B.
- Re: Regex for finding a '?' in a String
- From: Daniel Dyer
- Re: Regex for finding a '?' in a String
- Prev by Date: Re: Java 1.6 Heisenbug involving startsWith
- Next by Date: Re: Regex for finding a '?' in a String
- Previous by thread: When will reflections support casting (especially for constructors, etc) properly?
- Next by thread: Re: Regex for finding a '?' in a String
- Index(es):