Code Preview
#!/usr/bin/env python3
import re
def extract_variables(bio_text):
variables = {}
# Extract company
company_match = re.search(r'(?:at|@)\s+([A-Z][A-Za-z\s]+)', bio_text)
if company_match:
variables['company'] = company_match.group(1).strip()
# Extract title
title_match = re.search(r'(CEO|CTO|VP|Director|Manager)', bio_text, re.I)
if title_match:
variables['title'] = title_match.group(1)
# Extract location
location_match = re.search(r'(?:in|based in)\s+([A-Z][a-z]+)', bio_text)
if location_match:
variables['location'] = location_match.group(1)
return variables
# Full script in download...