Regular Expression in Teradata

Database

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)
1 REPLY

Re: Regular Expression in Teradata

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

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

It returns BIVT|0|OK

Thanks,

Venkatesh Kumar Saluvathi