1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] Replace special character if between square brackets by asp classic

Discussão em 'Outras Linguagens' iniciado por Stack, Outubro 17, 2024 às 19:43.

  1. Stack

    Stack Membro Participativo

    i have more than 4000 content page and need replace character only between square brackets [ ] by asp classic or SQL Query or javascript if may

    MyText = "aaa bbb [aa@aa] 1234 (aabb) 56 {2ab} ee f [bbzz] abcd aa bb 11 [ab]"


    Replace 'a' to 'X' and 'b' to 'Y' Only in square brackets [ ]

    Need this Result = "aaa bbb [XX@XX] 1234 (aabb) 56 {2ab} ee f [YYzz] abcd aa bb 11 [XY]"


    i try this code but replace all character inside and outside square brackets :

    strResult = mid(MyText, InStr(MyText, "["), (InStrRev(MyText, "]") - InStr(MyText, "[") +1) )

    strResult=replace(strResult,"a","X")
    strResult=replace(strResult,"b","Y")

    Continue reading...

Compartilhe esta Página