Find all the numbers in a string using regular expression in Python

Posted by Andre Scott | Updated on

In this example, I have shared how to find all the numbers in a string using regular expression in Python. The parameters to these function are the pattern which we want to extract and the string from which we want to extract. Please note with below example we get only the digits and not the decimal points or the negative signs.

Program Output


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers