This content has been marked as final.
Show 4 replies
-
1. Re: regexp_replace
Saubhik Jul 6, 2011 12:01 PM (in response to user5116754)Like this ? REGEXP_REPLACE(str,'[^[a-z,A-Z]]*',' ') -
2. Re: regexp_replace
Frank Kulash Jul 6, 2011 12:04 PM (in response to user5116754)Hi,user5116754 wrote:
I think you'll need nested operations to do that. For example:
How to replace all this German letters like (ü,ö,ä...)
select regexp_replace('Jürgen könnte übermorgen den Text ändern.','[ÖÜÄöüäß]', '(oeaeuess') NEW_TEXT from dual;
Of course this doesn't work...
All suggestions are welcome.SELECT TRANSLATE ( REGEXP_REPLACE ( REPLACE ( 'Jürgen könnte übermorgen den Text ändern.' , 'ß' , 'ss' ) , '([ÖÜÄöüä])' , '\1e' ) , 'ÖÜÄöüä' , 'OUAoua' ) AS new_text FROM dual;
-
3. Re: regexp_replace
user5116754 Jul 6, 2011 12:14 PM (in response to Frank Kulash)Yesssss, it works. Thank you Frank.
...but a simple regexp_replace - statement can't achieve the same??? -
4. Re: regexp_replace
Frank Kulash Jul 6, 2011 12:36 PM (in response to user5116754)user5116754 wrote:
Sorry, I don't think so. Maybe you could use a single statement to replace all the umlauts, since there is a common pattern to all of them, but the ess-zed would still need a separate operation.
Yesssss, it works. Thank you Frank.
...but a simple regexp_replace - statement can't achieve the same???
You really want something like TRANSLATE that works on strings, not single characters, but, unfortunately, that doesn't exist. See the following thread for another work-around:
SQL Query
The solution I posted always replace the umlaut with a lower-case 'e'. If you want to detect all-upper-case words, and change 'ÜBER' into 'UEBER' (rather than 'UeBER'), then use PL/SQL.