Use this regular expression to match square brackets or single quotes:
/[\[\]']+/g
Replace with the empty string.
console.log("['abc','xyz']".replace(/[\[\]']+/g,''));
More Related Contents:
- Regex – To allow numeric, only characters R, N, X, B, @ [closed]
- Find particular string from URL in JavaScript
- Negative lookbehind equivalent in JavaScript
- JavaScript regex multiline text between two tags
- Case insensitive regex in JavaScript
- Remove not alphanumeric characters from string
- I want to remove double quotes from a String
- Count number of matches of a regex in Javascript
- Password REGEX with min 6 chars, at least one letter and one number and may contain special characters
- Regex created via new RegExp(myString) not working (backslashes)
- Replace a Regex capture group with uppercase in Javascript
- How to write regex to validate dates?
- Replacing from javascript dom text node
- Javascript Regex to replace text NOT in html attributes [duplicate]
- Replacing the nth instance of a regex match in Javascript
- How to extract a string using JavaScript Regex?
- JavaScript Regex Global Match Groups
- How can I put [] (square brackets) in RegExp javascript?
- Interesting test of Javascript RegExp [duplicate]
- Javascript Regex to match only a single occurrence no more or less
- All characters in a string must match regex
- RegEx to match stuff between parentheses
- Regex eError when using {1}+ possessive quantifier in JavaScript regex
- Best way to parse HTML in Javascript
- How to insert space every 4 characters for IBAN registering?
- JavaScript Regex to match a URL in a field of text
- Regular Expression Pattern With A Variable
- Extract keyword from Google search in Javascript
- Regex matching emoticons
- Regex: only alphanumeric but not if this is pure numeric