This seems like it should be easy and straight-forward but I can't solve this for the life of me.
Using jQuery, I want to match a string with its parentheses using Regex.
This is the string I'm trying to match: (CA)
This is my Regex: (/\(([A-Z]{2})\)/)
I've tried using new RegExp("\\(([A-Z]{2})\\)") as well.
No matter what I try I always end up with the Unrecognized expression: (CA) error message in my console.
What am I doing wrong? Any advice would be much appreciated!
Thanks!
EDIT Aug. 4 @ 9:09 GMT-7
Here is my full code:
<div class="athlete-name">Random Joe</div>
<div class="high-school">Jonah Lomu Senior (CA)</div>
Upon successful match, the (CA) will be replaced with <img src="/img/flag/ca.svg"/>