I have some sequences in a string denoted by "@number" (/@\d/)
I want to remove any redundant sequences, where @2 is followed by @2,
I only want to remove them if another identical @number sequence is found directly after somewhere in the text, so for @2lorem@2ipsum
the 2nd @2 is removed, but for @2lorem@1ipsum@2dolor
nothing is removed because @1 is between the two @2 sequences.
"@2randomtext@2randomtext@2randomtext@1bla@2bla2@2bla2"
becomes:
"@2randomtextrandomtextrandomtext@1bla@2bla2bla2