I am looking for a way to simplify a regular expression which consists of values (e.g. 12345), relation signs (<,>,<=,>=) and junctors (&,!). E.g. the expression:
>= 12345 & <=99999 & !55555
should be matched. I have this regular expression:
(^<=|^<= | ^>= | ^>= |^<|^>|^< |^> |^)((!|)([0-9]{1,5}))( & > | & < |& >=|&>=|&<=||&<=|&>=|&<|&>|&| &| & |$))*
I am especially unhappy with the repetition of <=, >=, <, > at the beginning and end of the expression. I would be glad to get a hint how to make it simpler e.g. look ahead, look back.