0 : 0 NB. ================================================== examples
str=. 'hello Mr John Dow hi miz Sarah Bernard hi mr none'
'/(mr|miz) ([a-z]+) ([a-z]+) */\3, \2 (\1) -- was: \0\n' rxs str
hello Mr John Dow hi miz Sarah Bernard hi mr none
'/(mr|miz) ([a-z]+) ([a-z]+) */\3, \2 (\1) -- was: \0\n/i' rxs str
hello Dow, John (Mr) -- was: Mr John Dow
hi miz Sarah Bernard hi mr none
'/(mr|miz) ([a-z]+) ([a-z]+) */\3, \2 (\1) -- was: \0\n/ig' rxs str
hello Dow, John (Mr) -- was: Mr John Dow
hi Bernard, Sarah (miz) -- was: miz Sarah Bernard
hi mr none
p1=. '!(mr|miz) (([a-z]+) )?([a-z]+) *'
r1=. '!\4,s,(":#\4),s, \3, s,\1,s,'' used: '',(":+/a:~:\_),\n [ s=.''/'''
o1=. '!gie'
(p1,r1,o1) rxs str
hello Dow/3/John/Mr/ used: 5
hi Bernard/7/Sarah/miz/ used: 5
hi none/4//mr/ used: 3
)