*
The moose likes Other JSE/JEE APIs and the fly likes regular expression in java 1.4 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "regular expression in java 1.4" Watch "regular expression in java 1.4" New topic
Author

regular expression in java 1.4

Ashutosh Singh Jadon
Greenhorn

Joined: Sep 14, 2011
Posts: 18
hi all,

i have a project in java1.4 where i am tring to insert a string in method with regular expression($) but it is giving me the error array index out of bound . can any one suggest me the method to convert that (string+regular expression) into (string) .
String s = obj.getString(); -- giving an error arrayindexoutofbound .
s="my data commissoned to $125";


Thanks and regards,
Ashutosh Singh Jadon|SCJP 6.0|
Ashutosh Singh Jadon
Greenhorn

Joined: Sep 14, 2011
Posts: 18
Ashutosh Singh Jadon wrote:hi all,

i have a project in java1.4 where i am tring to insert a string in method with regular expression($) but it is giving me the error array index out of bound . can any one suggest me the method to convert that (string+regular expression) into (string) .
String s = obj.getString(); -- giving an error arrayindexoutofbound .
s="my data commissoned to $125";

String coming in this getter method is "my data commissoned to $125" and because of this $ sign it is giving the exception . is there any way to get this string as a string in java 1.4 .
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
The $ symbol has special meaning in regexps; you need to escape it via a single (or double, depending on context) backslash, like \$ or \\$.
Ashutosh Singh Jadon
Greenhorn

Joined: Sep 14, 2011
Posts: 18
Thanks Tim , can we convert or nullify the regexps value in an string by any method in java1.4 because in java 1.5 there is quoteReplacement method .
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Wrong forum. This forum is for Spring.

Not Strings. ;)

Moving this to some other forum that can take Regex questions.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: regular expression in java 1.4
 
Similar Threads
use of regular expression in java
how to split string using . operator
StringTokenizer not helping in splitting
Using Patterns for Date String
getting problem in converting the backward slash to forward slash