Dear Masters! Is it possible to ensure, that only characters with codes between 0 and 255 will be accepted by regular expression, but all with the codes up to 256 not? Thank you!
Yes, you can represent hex ranges in regex:
boolean matches = string.matches("[\\x00-\\xFF]+");
This will match everything which contains at least one character in the 0x00-0xFF range.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With