[英]regexp_substr a numeric ratio within a string
如何利用 regexp_substr function(紅移)從字符串中提取數字比率? 例子:
Product name 1:4 subtype name
10:5 product name
[5:1] product name
product name [1:15]
只想捕獲文本的 1:4 部分。
謝謝
您可以像這樣使用regexp_substr()
:
regexp_substr(mycol, '[0-9]+:[0-9]+')
這將提取模式的(第一次)匹配,如果至少有一個數字,然后是分號,然后是至少一個數字。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.