Format 1: regexrep(
,regular expression,replacement string)
Format 2: regexrepw(
,regular expression,replacement string)
Return the starting position of the longest substring where the defined regular expression matches with the character string
. Use the regexrepw function if
or regular expression contain multibyte characters, or when characters in Shift_JIS encoding does not correspond to search results.
In row where id=1,id=2, the matched substrings in the column is replaced with MMM.
$ more dat1.csv
id,str
1,caabaa
2,acabaaa
3,
4,cbcbcc
$ mcal c='regexrep($s{str},"c.*aa","MMM")' a=rsl i=dat1.csv o=rsl1.csv
#END# kgcal a=rsl c=regexrep($s{str},"c.*aa","MMM") i=dat1.csv o=rsl1.csv
$ more rsl1.csv
id,str,rsl
1,caabaa,MMM
2,acabaaa,aMMM
3,,
4,cbcbcc,cbcbcc