match
returns an array.
The default string representation of an array in JavaScript is the elements of the array separated by commas. In this case the desired result is in the second element of the array:
var tesst = "afskfsd33j"
var test = tesst.match(/a(.*)j/);
alert (test[1]);
More Related Contents:
- Get Substring between two characters using javascript
- Fastest way to check a string contain another substring in JavaScript?
- How can I replace a regex substring match in Javascript?
- JavaScript text between double quotes
- What’s the best way to validate an email address in JavaScript?
- Why this javascript regex doesn’t work?
- How can I match a whole word in JavaScript?
- Regular Expression for password validation
- Recursive matching with regular expressions in Javascript
- How can I match multiple occurrences with a regex in JavaScript similar to PHP’s preg_match_all()?
- Converting any string into camel case
- utf-8 word boundary regex in javascript
- How to split a long regular expression into multiple lines in JavaScript?
- Works in Chrome, but breaks in Safari: Invalid regular expression: invalid group specifier name /(?
- Javascript – return string between square brackets
- How to prevent Javascript injection attacks within user-generated HTML
- Strange JavaScript idiom – what does “/xyz/.test(function(){xyz;})” do?
- How to split a string at the first `/` (slash) and surround part of it in a “?
- regex street address match
- jQuery Youtube URL Validation with regex
- Replace function not replacing [duplicate]
- Why can’t I use accented characters next to a word boundary?
- Include Arabic characters in JavaScript regular expression?
- Optimize long lists of fixed string alternatives in regex
- Replace certain arabic words in text string using Javascript
- What does the “Nothing to repeat” error mean when using a regex in javascript?
- Regular expression for number with length of 4, 5 or 6
- Use RegExp to match a parenthetical number then increment it
- Convert string to Pascal Case (aka UpperCamelCase) in Javascript
- How do you split a javascript string by spaces and punctuation?