regex
daddy, August 09, 2022 - 12:54 pm UTC
Regex version works only on English alphabet, no "special" characters (such as "ľšč") supported.
August 09, 2022 - 1:02 pm UTC
Well that depends on the language you're using!
But yes, in general if you need to support diacritics you should use character classes instead.
nice
A reader, November 10, 2022 - 5:07 pm UTC
Try word separator \w
bias, June 27, 2023 - 6:41 am UTC
try \w : word separator
with rws as (
select 'Ask Tom' s from dual union all
select 'Become Again Tom' s from dual union all
select 'United Sates' s from dual
)
select regexp_substr ( s, '\w*' ) regex,
substr ( s, 1, instr ( s, ' ' ) - 1 ) sub
from rws;
June 27, 2023 - 12:45 pm UTC
Thanks for sharing.
lots of possibilities with "regexp" in place.
Rajeshwaran, Jeyabal, June 28, 2023 - 2:13 am UTC
Even perhaps like this
demo@PDB1> with rws as (
2 select 'Ask Tom' s from dual union all
3 select 'Become Again Tom' s from dual union all
4 select 'United Sates' s from dual
5 )
6 select regexp_substr( s, '\S+' ) from rws ;
REGEXP_SUBSTR(S,'\S+')
----------------------------------------------------------------
Ask
Become
United
June 28, 2023 - 12:55 pm UTC
Yes, that works too