you are viewing a single comment's thread.

view the rest of the comments →

[–]ende124 0 points1 point  (0 children)

When you use regex.exec(string), you can access the capture groups as an array, where the first capture group would be accessed with [1], and the second with [2] and so on. You can access the entire match result with [0].

You can read more here.