Regular Expression in Teradata


Regular Expression in Teradata

Hi All,

Finally got some idea on Regular expressions with control characters in Teradata..

Sample:-(With One Control Character)

select regexp_replace('BIVT 0','[[:cntrl:]]','|')

It returns BIVT|0  (Tab is replaced with '|')

(With Multiple Control Character)

select regexp_replace('BIVT 0 OK','[[:cntrl:]]','|')

It returns BIVT|0 OK

It works for single occurence,but if my I/P comes with multiple occurence of control characters...How to replace those control characters with '|'???

Tags (1)

Re: Regular Expression in Teradata

Finally we arrived at the using the same function with parameters...

select regexp_replace('BIVT 0 OK','[[:cntrl:]]','|',1,0,'i')

It returns BIVT|0|OK


Venkatesh Kumar Saluvathi