Start a new topic

Reg Ex - Use of Characters and meanings

Hi all,


I'm trying to tweak an old profile. The Reg Ex seperates a ConsID (if applicable) from a line of data:


ConsID/AppealID/PacgageID


Please see below:


image


My team enter the '/' manually (donation form), but i need to replace '/'  with either '-' or '_' or '.'   .


When I replace the '/' in the codes above, with a Hyphen, the test seems to remove digits from the ConsID.


image


Can someone point me in the right direction please? I'm sure i'm missing something obvious.


Thanks


Matt


1 Comment

it's because hyphen is a protected character in regex.  You have to escape it by putting a backslash in front.


so replace the current slash with \- instead.

Login to post a comment