javascript - How to select every second occurrence using regular expression -


I am writing jquery code that will call every second event in the code "|" Will remove.

There is a problem writing regular expressions for this.

Using the regular expression "|" How to specify every second incident?

You must match 2 pipes, and replace the other:

 < Code> theString.replace (/ \ | ([^ |] *) \ | / G, '| $ 1');   

Below is:

Comments