Removing characters from a string

Hi,

I have a requirement of removing all the characters from a string to get the double value.

So my variable would have a value like "EUR123.35", I want to get 123.35 from it. We can have any type and number of characters in the string.

SO I have the following code

#CODE

Pattern m_Pattern = Pattern.compile("a-zA-Z");

priceTag=priceTag.replace(m_Pattern.pattern(), "");

#ENDCODE

I am using java 1.4.2. I get the following error

java.lang.NoSuchMethodError: java.lang.String.replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

I find that this method has been implemented in 1.5. So how can I implement it pre 1.5 version...

thanks as always for your time and feedback...

cheers

[782 byte] By [chabhia] at [2007-11-27 4:29:53]
# 1
> I am using java 1.4.2.You could use String.replaceAll() method.
hiwaa at 2007-7-12 9:39:02 > top of Java-index,Java Essentials,New To Java...
# 2
I think this is what you meant to do: priceTag = priceTag.replaceAll("[a-zA-Z]+", "");
uncle_alicea at 2007-7-12 9:39:02 > top of Java-index,Java Essentials,New To Java...
# 3
thank you very much for your responses...you were right..i needed all and []....thanks for your time and feedback...cheers
chabhia at 2007-7-12 9:39:02 > top of Java-index,Java Essentials,New To Java...