Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python re.findall()

# Program to extract numbers from a string

import re

string = 'hello 12 hi 89. Howdy 34'
pattern = 'd+'

result = re.findall(pattern, string) 
print(result)

# Output: ['12', '89', '34']
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Python
ADD COMMENT
Topic
Name
8+9 =