簡體   English   中英

regexp_substr 字符串中的數字比率

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM