Advertisement
BdW44222

02. Find Variable Names in Sentences

Aug 12th, 2021
841
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.13 KB | None | 0 0
  1. import re
  2.  
  3. data = input()
  4. pattern = r"\b_([a-zA-Z0-9]+)\b"
  5.  
  6. matches = re.findall(pattern, data)
  7.  
  8. print(",".join(matches))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement