Extract Numbers from String

Extract all numbers from a string.

Code

General
import re
return [int(n) for n in re.findall(r'\d+', str)]

Parameters

The string to extract numbers from

Server

More Python Snippets