I was wondering if the concept of regex was applicable only to String types in Java, or can be applied to numerical values too. For instance:
Find all integers from a list of integers which are greater than x but less than y
Find all integers from a list of integers greater than x
Find all integers from a list of integers which are less than ( x-10)
Does the concept exist for numerical values too but isn't implemented in Java, or is it too challenging to implement for numerical values?
As far as I understand, regex should be applicable to any place where searching is involved (irrespective of value types).
As suggested in answers and comments, Java 8's Stream
functionally does what I am looking for (via filters etc), but my question was mainly for missing short hand forms in the list of regex patterns for numerical values; such as, if > x exists as a pattern, that would have been easier.