I have a requirement to identify two patterns in a String, and if exists, i need to remove the substrings. Currently my code is below where I'm removing the substrings in two steps. I want to create a single Regex to identify "A," or "S," if exists, to replace with empty string.
My code:
if (charCode === characteristicsCode.SERIAL_NUMBER) {
charValue = charValue.replace(/[(A,)]/g, '');
charValue = charValue.replace(/[(S,)]/g, '');
}