Like this:
str.replace(regex, function(match, $1, $2, offset, original) { return someFunc($2); })
More Related Contents:
- Regex – To allow numeric, only characters R, N, X, B, @ [closed]
- Regex for Email Address along with name format [duplicate]
- Negative lookbehind equivalent in JavaScript
- Remove not alphanumeric characters from string
- I want to remove double quotes from a String
- Regular Expression | Leap Years and More
- How to write regex to validate dates?
- Replacing from javascript dom text node
- Javascript Regex to replace text NOT in html attributes [duplicate]
- Javascript – Regex to validate date format [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?
- What does the regular expression /_/g mean?
- Highlight current page in jquery
- Highlight word in HTML text (but not markup)
- Replacing accented characters with plain ascii ones [duplicate]
- Javascript RegExp for splitting text into sentences and keeping the delimiter
- Best way to parse HTML in Javascript
- Commenting Regular Expressions
- How to insert space every 4 characters for IBAN registering?
- Regular Expression Pattern With A Variable
- How can I use regex to get all the characters after a specific character, e.g. comma (“,”)
- Match all URLs in string and return in array in JavaScript
- Regex.prototype.exec returns null on second iteration of the search [duplicate]
- Part of String Case Insensitive in JavaScript Regex (?i) option not working
- JavaScript: how to use a regular expression to remove blank lines from a string?
- Regular Expression to MATCH ALL words in a query, in any order
- Javascript – how to find hebrew?