You can even remove the single or double quotes from a string using the regex above. However, you need to keep in mind that you’ll have to use string interpolation in such cases to avoid string’s end-of-line mismatching. That is, instead of writing “Peter’s mother’s name ends with “a””, you could write `Peter’s mother’s name ends with “a” ` without having to switch between single and double quotes. Here’s an example to demonstrate the same:
If you have any doubts or suggestions, let me know in the comments below!