_D_
asked on
regular expression back references?
stupid question - I am using String's replaceAll(pattern, replacement) how do I reference the captured groups "(whatever)" from the pattern in the replacement? \1 doesn't work (and the documentation says that's what it is) and neither does \\1
thanks
thanks
.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
no quite what I was looking for, but I don't see a better way
ASKER
what I need to do is convert the string to "Title Case", ie first letter of every word capitalized, what I have for the replace so far is:
replaceAll("\\b(\\w)","$1"
which just relaces each first character with the same one - how to I capitalize that back reference? Or do I need to do this is some completely different way?
thanks