Rex match a string in JS

I have few set of strings as mentioned below


I would like to get users in all four cases as output using regex in Javascript

I tried below in


It doesn’t seem to come up right.
Any help on this would be appreciated.

17 thoughts on “Rex match a string in JS”

Leave a Comment