javascript regex pattern with an array -
I want to create a regex pattern which should be able to search through an array.
We say:
var arr = ["first", "second", "third"]; var match = text.match (/ & lt; ara & gt; /); who should only be able to match
& lt; First & gt; Or & lt; Seconds & gt; Or & lt; Third & gt; ...... but should ignore
& lt; ffirst & gt; Or & lt; Dummy & gt; I need an efficient approach.
Any help would be great thanks
You (a | b | c) should search for a particular word . . has been created from arr by joining the values as <
Comments
Post a Comment