1. Remove control characters and space (the red mark is a space) (oracle example):
select 'asdfo'||chr(9)||'dsu iue', regexp_replace('asdfo'||chr(9)||'dsu iue', '[[:cntrl:] ]','') from dual
2. The following will match utill second occurence, *? is lazy qualifier so it will stop when it find the next foo:
foo.*?(foo)
string: goo foo goo goo foo goo foo goo foo goo fo
3. The following will match utill last occurence, as we removed the lazy qualifier from #2, it will stop when it find the last foo:
foo.*(foo)
string: goo foo goo goo foo goo foo goo foo goo fo
No comments:
Post a Comment