I have input text that contains a \' like in this text \"Frank\'s Reel Movie Reviews\"
how do I get rid of the \'
I have tried
.replace (/\\\'/ig
If you want something very selective to remove (or replace by anything like a space) apostrophes but not the symbol ' for feet imperial unit, use:
val apostropheRegex = """(?<=[a-zA-Z])'(?=[a-zA-Z])"""
"john's carpet is 5' x 8'".replaceAll(apostropheRegex, "XXX") // johnXXXs carpet is 5' x 8'
It means "Replace all symbol ' that are between two letters".