Dear All,
I hope to get only number from sentence by using Regular Expression.
Could you please let me know how to do it!?
/url/prd/429791 → 429791
/url/prd/437316?recopick=46&product_type=R → 437316
thanks,
Best regards,
Dear All,
I hope to get only number from sentence by using Regular Expression.
Could you please let me know how to do it!?
/url/prd/429791 → 429791
/url/prd/437316?recopick=46&product_type=R → 437316
thanks,
Best regards,
Hi,
Is there any rule about the target?
If it’s always 6 digits, the following will work.
System.Text.RegularExpressions.Regex.Match(yourString,"\b\d{6}\b").Value
Regards,
Hello!
It works well! Thank you so much
Could I ask one more question?
If the number is over 6 digit, How can I get only 6 digit from left?
When I used your Regular Expression, It became ‘blank’,
thanks,
Best regards,
Wow I really appreciate about your advice!
It works well… There is no blank.
However, I’m really sorry… I think that I should select Yoichi-san’s answer because it was posted earlier.
Thank you so much for your professional advice again and Have a nice day!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.