How to format String with a pattern I want to format my string in my select statement but I cant seem to find the syntax for this pattern.

I have a column of card_num with 16 digits and i want to have a dash(-) after the first four digits. 

Original card_num: 
1234567891234567

Desired output:
1234-567891234567 

I think regex can do this but cant find elsewhere the right code for this pattern.

Any idea how to do this? Thanks.
You could use substr() and concatenation (Oracle 12c): select the first 4 characters, then concatenate '-' and the rest of the string.

create table t
as
select '1234567891234567' card_num from dual;

select card_num
, substr(card_num, 1,4) || '-' || substr(card_num, 5, length(card_num) - 4) 
  formatted
from t;

SQL&gt; select card_num
  2  , substr(card_num, 1,4) || '-' || substr(card_num, 5, length(card_num) - 4) 
  3    formatted
  4  from t;

CARD_NUM          FORMATTED          
1234567891234567  1234-567891234567 


... the table is "overkill" for this example - but it may make it easier to experiment/adjust your query.