1 Reply Latest reply on Nov 21, 2007 12:48 AM by 807603

    Search and replace, with pattern matching using a table

      I need to inspect a data stream and standardise a set of codes. I need to

      1. Match any patterns with a dash character and remove the dash and any following characters, eg BN-S -> BN, BN-SH -> BN, ARG-22 -> ARG, etc.

      2. Make a few specific word for word replacements, eg, PAEDSH -> PAED

      This is easy to hard code but can it be done using a table of regex substitutions? Can anyone give a pointer or link to some example code? The couple of regex replacement examples I've found use regex to locate but hard code substitutions.