Regex: Testing for entire string -
i'm learning how use regular expression, , i'm having difficulties problem.
suppose input number, , input returns true whole number if number contains @ least 1 7, no 9s.
for example: 123456789
should return false, , input of 12345678
should return true 12345678
.
what regular expression should used this?
i know terms 7+
, [^9]
involved, i'm not entirely sure how make return true entire number specific conditions (7+[^9]
returns true input 12345678
12345678
9, when want return true 12345678
).
sorry if worded question badly.
you may try like: ^[0-8]*7[0-8]*$
Comments
Post a Comment