Negative look ahead java
- by venu
I need an expression to capture a string like this
"A"[A string that is NOT atleast 5 and atmost 6 digits]"B", In other words capture anything that is NOT the following
A[0-9][0-9][0-9][0-9][0-9]B
A[0-9][0-9][0-9][0-9][0-9][0-9]B
I have tried the negative look ahead
regex = "a((?![0-9]{5,6}).)*d" ;
But it fails to capture all scenarios.
Please help
venu