My string is like this – “Some text &&Power Cable&& more text &&Supervisor&&
Now I have an array which contains values like – arr[0]=Power Cable and arr[1]=Supervisor. so what I want to do is- parse my string and find out these tokens out of it which in this case are – 1) Power Cable and 2) Supervisor and then compare these tokens to those I have in my array.
Note that there can be n number of tokens in the string(all dynamic) and they can be anywhere, meaning at the start of the string or at the end or somewhere in middle. I tried few regex but none of them are giving me the result I want.
You can use a JavaScript split() function.