I have a string which could contain multiple delimiters right next to each other, for example |||, although it could be any number of adjacent delimiters. I need to replace any place "in between" the adjacent pair with a specific character. These delimiters will only need to match if there is no character between the delimiter, not even spaces.
So Replace:
ABC|||Blah with ABC|*|*|Blah
However, when I try it, it will not "fill in" the gap between all of them. In the same example above it only results in ABC|*||Blah
Four delimiters result in ABC|*||*|Blah
How do I write a regex pattern that will do what I need? I am using php's preg_replace.