import re
 
regex = r"(?<!\S)_([a-zA-Z0-9]+)\b"
 
s = ("Calculate the _area of the _perfectRectangle object.\n\n"
	"The _id and _age variables are both integers.\n\n"
	"__invalidVariable _evenMoreInvalidVariable_ _validVariable\n\n"
	"_validVariable_test"
	)
 
print(re.findall(regex, s))