How to take specific digits from given number using regex?

Hi All,

I want to take out specific three digits from given number. Looking for quick help.
Number is 51599710050269 Output is 997.


For regex there should be some pattern then only we will be able to achieve do you see any pattern of this number.

Is the requirement always get three digits starting from fourth digit. If that is the case we can convert this integer to string and we can use simple substring method to extract the desired digits.

Please try below. Thanks



Welcome to forums

Check below for your reference


Hope this will help you


1 Like

thanks for quick help.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.