[英]Regex for specific numbers and special characters
我想從下面的輸入字符串中提取值 9.6%,2021,4th 並嘗試使用不同的解決方案,但沒有按預期顯示 output。 輸入字符串: Gross Domestic Product decreased by 5.9% in volume in the fourth quarter 2021 and by 9.6% in 2021 - 4th Quarter 2021
var pattren = "^-?\\d*(\\.\\d+)?$";
var result = Regex.Match(s, pattren);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.