regexp replace [message #652608] |
Tue, 14 June 2016 13:29 |
rajivn786
Messages: 161 Registered: January 2010
|
Senior Member |
|
|
Hi,
I have quick doubt regarding regexp which I am poor at.
Ex :
Input String : Contact the doctor Dr. Remo Henry at 646-133-7089 on 02/02/2016.
Output : Contact the doctor Dr. Fname Lname at phone on date.
Select regexp_replace ('Contact the doctor Dr. Remo Henry at 646-133-7089 on 02/02/2016.', ) from dual;
From the above, wherever there is a name/phone/date in the string, any first/last name of doctor should be replaced by string "Fname Lname" , phone number should be replaced by string "phone" and date should be replaced by string "date".
Thanks.
|
|
|
|
Re: regexp replace [message #652610 is a reply to message #652609] |
Tue, 14 June 2016 14:08 |
rajivn786
Messages: 161 Registered: January 2010
|
Senior Member |
|
|
We don't need to know...All the above process it to just mask the data ...It doesn;t matter whether it's first name or last name.
For the phone number as long as the string has the format of nnn-nnn-nnnn or (nnn)-nnn-nnnn it needs to be replace by string "phone". (as most of the ph no's are in this format)
The only reason is the end user shouldn't know about the doctor or phone details.
|
|
|
|
Re: regexp replace [message #652612 is a reply to message #652611] |
Tue, 14 June 2016 14:23 |
rajivn786
Messages: 161 Registered: January 2010
|
Senior Member |
|
|
Thanks for the questions.
We need to go by formats..
For the names, as per our data (being a hospital) as long as there are 2 words followed by "Dr." it should be replaced by Dr. Fname Lname. Even if it's represented as Dr. Contact The, it should be replaced by Dr. Fname Lname
Similarly as long as the data format is nnn-nnn-nnnn or (nnn)-nnn-nnnn it should be replaced by text "phone"
[code]
|
|
|
|
Re: regexp replace [message #652614 is a reply to message #652613] |
Tue, 14 June 2016 14:37 |
rajivn786
Messages: 161 Registered: January 2010
|
Senior Member |
|
|
Thanks. Even the date "02/02/2016" needs to be replaced by "Date"
Anything in the format of nn/nn/nnnn shoule be formatted as text "date".
The output should be Contact the doctor Dr. Fname Lname at phone on date.
|
|
|
|
|
|