regex - How to delete repeated specific characters -


i need replace "@" "-" in string. straightforward, need replace multiple "@@@@@" 1 single "-". ideas on how latter asp. here example:

input string: @introducción los esquemas algorítmicos: apuntes y colección de problemas. report lsi-97-6-t@@@@@@@@09/30/1997@@@@@tre@

desired output: -introducción los esquemas algorítmicos: apuntes y colección de problemas. report lsi-97-6-t-09/30/1997-tre-

thanks.

try classic asp:

dim regex set regex = new regexp   regex     .pattern = "([\@])\1+|(\@)"     .global = true     .multiline = true end strmessage = regex.replace(str, "-") 

this match every occurrence of multiple @@@@ or single occurrences of @

not sure language using here's expression in full delimiters: /([\@])\1+|(\@)/g

edit - simpler: /@+/g

enter image description here


Comments