I have this regex ...
/user/([A-Za-z0-9]*)
What matches this input line ...
/user/me
What brings this result to the console ...
['/user/me', 'me', index: 0, input: '/user/me']
Also see this example ...
Regex: /user/([A-Za-z0-9]*)/([A-Za-z0-9]*) Input: /user/me/you Result: ['/user/me/you', 'me', 'you', index: 0, input: '/user/me/you']
The first result returns me , but the second returns me and you , is there a built-in function in node.js that will extract these occurrences or will I need to skip this array with conditions?
source share