I have a complex situation where I need to parse a very long string. I have to look for a pattern in the string and replace that pattern with another. I know I can simply use find/replace method but my case is bit different.
I have a string that contains the following pattern
#EPB_IMG#index-1_1.jpg#EPB_IMG
#EPB_IMG#index-1_2.jpg#EPB_IMG
#EPB_IMG#index-1_3.jpg#EPB_IMG
#EPB_IMG#index-1_4.jpg#EPB_IMG
and I want it to format as
#EPB_IMG#index-1_1.jpg|index-1_2.jpg|index-1_3.jpg|index-1_4.jpg#EPB_IMG
I don't know much about Regex and seeking for help.