How do I use an ORACLE REGEX function to remove all leading and trailing line break characters and spaces?
For example, assume I have the following string where refers to actual invisible carriage return line feed characters. Here's the input:
" SELECT * FROM TABLE "
And here's the desire output:
"SELECT * FROM TABLE"
This would do it if regex_replace() is a requirement:
regex_replace()
select regexp_replace(' SELECT * FROM TABLE ', '^s*|s*$', '') as hello from dual
See https://www.techonthenet.com/oracle/functions/regexp_replace.php for documentation.
1.4m articles
1.4m replys
5 comments
57.0k users