Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Im trying to get this regex to match my data-attributes. The Regex does seperate the words into words with a | but my //matching code isnt working.
- //Any ideas?
- var string = "car, boat, Anotherrandomword';
- var regApproved= new RegExp(`\\b(${string.split(',').join('|')})\\b`, 'gi')
- // console.log(regApproved);
- rtnData = (
- $(this).attr("data-payment").match(regApproved)
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement