Extract one or multiple substringsbetween two start and end strings.
Project description
string_grab
Extract one or multiple substrings between two start and end strings.
text = """Gender: female
Race: White
Birthday: 3/23/1973 (50 years old)
Mobile: 715-523-1076
Mobile: 715-563-3967
Street: 4674 Lynn Avenue
City, State, Zip: Eau Claire, Wisconsin(WI), 54701"""
from string_grab import grab
birthday = grab(text, start="Birthday: ", end="\n")
print(birthday)
>> "3/23/1973 (50 years old)"
from string_grab import grab_all
for number in grab_all(text, start="Mobile: ", end="\n"):
print(number)
>> "715-523-1076"
>> "715-563-3967"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
string_grab-0.0.2.tar.gz
(8.8 kB
view hashes)