I have to write regular expressions to match some tokenizable text, and it will be cumbersome to add all the `\s*` and `\s+` where the amount of whitespace is insignificant or not required at all.

What I'd like to have is a function that accepts a regex and a list of delimiter tokens, and then add the whitespace matching for me.

For example:

```
make_whitespace(regex="foo\.(\w+)\(a\)",delimiters="()[]{},.+-")

```

should return

```
"foo\s*\.\s*(\s*\w+\s*)\(\s*a\s*\)"

```

Maybe there is already a better way to achieve this rather than hacking an existing regex; but I think using a full parser generator would be overkill. I am using Python.

Thanks.