Yes, it is possible with proxy.
You can create rules /ip proxy access, regular expressions are supported too there,
Small hits in using regular expressions:
* \\ symbol sequence is used to enter \ character in console
* \. pattern means . only (in regular expressions single dot in pattern means any symbol)
* to show that no symbols are allowed before the given pattern, we use ^ symbol at the beginning of the pattern
* to specify that no symbols are allowed after the given pattern, we use $ symbol at the end of the pattern
* to enter [ or ] symbols, you should escape them with backslash \.