Link to home
Start Free TrialLog in
Avatar of rgarimella
rgarimella

asked on

Reg Ex

Hi Folks,

I was trying to replace a carriage return in a form field with a <BR> but for some reason it does not work. Here is the code. If i replace "\r/g" with any other char like 13 it works.

Function EncodeBreak(ssString) 'This function replaces special characters
      If len(ssString) > 0 Then
            ssString = Replace(ssString, "'", "''")
            ssString = Replace(ssString, "\r/g", "</BR>")            
      End If
      EncodeBreak = ssString
End Function

any ideas

Thanks

RG
ASKER CERTIFIED SOLUTION
Avatar of mvidas
mvidas
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just to add on real quick, you may need to use    Server.CreateObject    instead of just CreateObject, forgot to include that earlier
Avatar of rgarimella
rgarimella

ASKER

Thanks Matt,

Worked like a charm

Glad to help!