I am new to regular expression. I need to extract between
two string pattern ([[tag:: & ]]) and for each
occurrence.
For Example:
If the text is :
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus [[tag::4797897]] mus. Donec quam
felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa
quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu.
[[tag::4797800]] [[tag::4797769]]
As I want the extract text between [[tag:: and ]] ,
the expected output should be 4797897 , 4797800 and 4797769
I am using Javascript and JQuery
Can some please help me . Thanks in advance
Royce Roy
20-Jan-2015To achieve the desired results you can use the exec() method in a loop, pushing the match result of the capturing group to the results array.