import re

regex = r"\[H] (.+?) \[W] (.+)"
test_str = "[H] $10 [W] 100 credits"

matches = re.search(regex, test_str)
if matches:
	variable1 = matches.group(1)
	variable2 = matches.group(2)

	print(variable1)
	print(variable2)