sql - Remove special character from end of string -


i looking remove special characters end of string.

input:

looking oracle ~( looking ~! oracle ~( stack looking ~! oracle ~( stack ## 

output:

looking oracle looking ~! oracle ~( stack looking ~! oracle ~( stack 

so need remove non-alphanumeric characters end of string only.

i looking oracle sql query achieve this.

select regexp_replace(str, '[^[:alnum:]]*$') from.... 

where str input string value. remove non-alphanumeric characters @ end of str ($ anchoring @ end; * means many possible consecutive characters; [...] means character matching set, , ^ within character matching set means negation). not giving third argument regexp_replace(), substring replaced nothing ('')


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -