Hey I am trying to create an input where someone can copy and paste in text that will contain account numbers in various formats (meaning it could be all number, numbers letters, or numbers/letters with a hyphen). I am using a text input box to capture the string and I am using /[\w-]+/g for my regex to capture the accounts.
My problem is that the function is only returning an array length of 1, rather than all the matches. The regex works in regex editors as well as other languages.
let inputValue = "4573560987356 hj08454083546 jioy-4536-erhd-4653 765-htr65-657ry"
let re = /[\w-]+/g
const outPutArray = re.exec(inputValue)
return outPutArray
(the string is made up, so no sensitive info)