I'm trying to match the word int that's either by its own or it's surrounded by underscores (_).
int # match
_int_ # match
__int__ # match
some_int # match
int_var # match
integration # doesn't match
mint # doesn't match
This is what I've been trying, but it only matches the second case above
pattern = re.compile(r"(?<=[\W_])int(?=[\W_])")
How should I go about doing this? Thanks everyone