A memo about regex matching and group matching in JavaScript.
Example
document.location.href.match(/https:\/\/(google|yahoo)(.*)/)
To extract the group match that would contain google or yahoo from here,
document.location.href.match(/https:\/\/(google|yahoo)(.*)/)[1]
It can be extracted as an array. It’s hard to understand if you don’t know it, as it’s not stored in some variable nor passed to a block like in Ruby.