Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

nodejs regex match doesn't match groups

AB_498 answered on April 13, 2023 Popularity 2/10 Helpfulness 1/10

Contents


More Related Answers

  • javascript access matched group in regex
  • js non capturing group regex
  • javascript regex all matches match
  • javascript regex grouping replace
  • replace with regex capture group
  • javascript regex named capture group
  • regex groups function
  • replace with regex capture group
  • nodejs extract regex group
  • regex serch in capture group
  • replace with regex capture group
  • named regex group JS

  • nodejs regex match doesn't match groups

    0

    The g flag with match will only return multiple whole matches, not multiple sub-matches

    Remove g to get groups but only the first match OR do it with .exec() and still get the first match: 

    Popularity 2/10 Helpfulness 1/10 Language javascript
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Apr 13 2023
    AB_498
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.