Organize some of the commonly used intercept and find character functions:
1. Find the number of occurrences of a character (string) in a string
SELECT LENGTH (regexp_replace (' Anne<br>lily<br>jane ', ' <br> ', ' @ '), ' [^@]+ ', ') ') COUNT from DUAL; --Return 2
2. Determine if a character has occurred in the source string
Select InStr (' Anne<br>lily<br>jane ', ' <br> ', 1) from dual--return 5
3. When a character appears multiple times in the source string, remove the last one (provided that the repeating character is bound to appear at the end of the source string)
SELECT SUBSTR (' anne<br>lily<br>jane<br> ', 1, (LENGTH (' anne<br>lily<br>jane<br > ')-length (' <br> '))) from dual--back to Anne<br>lily<br>jane
4. When a special symbol appears multiple times in the source string, only the number of digits behind the first occurrence is intercepted
Select substr (' Adssf.anne.aaaa ', 1,instr (' adssf.anne.aaaa ', '. ', 1) +3) from dual--return to Adssf.ann
Select substr (' asdfanne-asdfe-123456 '
, InStr (' asdfanne-asdfe-123456 ', '-', 1) +1
, Length (' asdfanne-asdfe-123456 ')-instr (' asdfanne-asdfe-123456 ', '-', 1) +1
) from dual--return to asdfe-123456
Oracle Intercept, find character functions (continuous update)