It's not a secret anymore!*
The moose likes Beginning Java and the fly likes java 6 replacell/repalcefirst Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

java 6 replacell/repalcefirst

joe nesbitt
Greenhorn

Joined: Dec 05, 2009
Posts: 17
Hi all,

The following regex works when used in string.replaceall() but not in case of string.replaceFirst().

String:



Expected output:




Regex:



Output (not desired):






No changes are made to the string, not sure why.

Please help!

Thanks in advance.
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Please UseOneThreadPerQuestion. This is your third thread about this question.


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36453
    
  15
Wouter Oet wrote: . . . This is your third thread about this question.
In which case this thread si closed. Thank you fo noticing, Wouter.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java 6 replacell/repalcefirst
 
Similar Threads
Reference Casting
java regex
Short-Circuit Logical Operators
x++ , ++x
explain this ...please