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 123456789, when want return true 12345678).

sorry if worded question badly.

you may try like: ^[0-8]*7[0-8]*$


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -