The to_char works fine when applied to single match like below.
select to_char('54523234', '99,999,999,999')
I use regex to find the match of only the currencies in the string. But when I apply to_char to the first group, it doesn't work
SELECT regexp_replace ('24444.88, 54523234.78, and 1044.52 are numbers in this example.',
'(([0-9]+){1,10})+\.([0-9]{2})', to_char('\1'.'99,999,999,999'))
FROM dual;
I want the output string to be displayed like:
24,444.88
, 54,523,234.78
and 1,044.52
are numbers in this example.
Here you go brother, that was a fun one: