How to retrieve the only number from a string?

Suppose there is a pop-up like below which has a combination of text and Numbers and if we want to retrieve only Numbers

Then we can use the below code to fetch only Numbers

Store the content into a variable and apply to replace(/[^0-9]/g, "") to the string and it will fetch only Numbers present in the string

Code Snippet

Logs from DS3


Last updated: June 26, 2023

If you have any feedback on this topic, please contact us at documentation@appvance.ai


Revision #4
Created 2026-07-31 15:40:08 UTC by Admin
Updated 2026-10-14 14:05:23 UTC by AI_Mananger