[{"riskAuditList":[{"auditLevel":"4","riskCode":"DDB"}],"useType":"1"}]这个字符串,我想截取"useType":"1" 中的数字1,不能写固定的索引位置哦

解决方案 »

  1.   

    你要取的这个数字前面,肯定是"useType":?
    这样就好办,截断然后再取几位就成
      

  2.   


    SQL> select replace(REGEXP_SUBSTR('[{"riskAuditList":[{"auditLevel":"4","riskCode":"DDB"}],"useType":"1"}]',
      2                               '"[[:digit:]]"',
      3                               1,
      4                               2),
      5                 '"')
      6    from dual;
     
    REPLACE(REGEXP_SUBSTR('[{"RISK
    ------------------------------
    1写的不是很好 可以参考下
      

  3.   

    select replace(REGEXP_SUBSTR('[{"riskAuditList":[{"auditLevel":"4","riskCode":"DDB"}],"useType":"11"}]',
                                 '"[[:digit:]]+"',
                                 1,
                                 2),
                   '"')
      from dual;稍微改动了下