I have text field that contains data in this format
1001.01:abcdefgh.1001.02:abcdefghijkl.1001.03:abcdefghfsdqfs.
I would like to insert an automatic line break so the result would be this :
1001.01:abcdefgh.
1001.02:abcdefghijkl.
1001.03:abcdefghfsdqfs.
other example with a field contains this
1245.01:qsdfqsdf.1245.02:qdfqsdmkj.1245.03:dfsdmfjmdf
I need that
1245.01:qsdfqsdf
1245.02:qdfqsdmkj.
1245.03:dfsdmfjmdf
So basically I need a way to insert a /n
at the beginning of each
xxxx.xx
(x always being a number)
1 Answer 1
This regular expression will gave you the expected result :
regexp_replace(
"your_field",
'(\\d{4}[.]\\d{2})',
'\n\1円'
)
It will insert a \n
even for the first occurence, so first characters in your examples. If you want to avoid that the expression will be :
regexp_replace(
"your_field",
'(.)(\\d{4}[.]\\d{2})', -- (point `.` here means any single character)
'\1円\n\2円'
)
.1001
?