KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm trying to remember the correct notation for doing find-replace regex matches in Java. Say I have the string String s = "My name is ''Eric'' and I have a bee called ''Eric'' and a fish called ''Wanda''." I want to do something like the following: s.replaceAll("\'\'$$\'\'", "$$"); To give: My name is Eric and I have a bee called Eric and a fish called Wanda. But I know $$ isn't the correct notation to capture whatever is in the '' and use it to replace the found match. What's the particular notation I'm looking for here? Thanks in advance. -Dave.
Tags (comma-separated)
Save Edits
Cancel