Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [d]{1,5}
- [d]{1,5}|[^0]{1}
- [1-9]d{0,4}
- ^0*[1-9]d{0,4}$
- #!/bin/perl -w
- while (<>)
- {
- chomp;
- print "OK: $_n" if m/^(?!0+$)d{1,6}$/;
- }
- 0
- 00
- 000
- 0000
- 00000
- 000000
- 0000001
- 000001
- OK: 000001
- 101
- OK: 101
- 01
- OK: 01
- 00001
- OK: 00001
- 1000
- OK: 1000
- 101
- OK: 101
- ^(?=regex1)(?=regex2)(?=regex3).*
- ^(?=d{1,5}$)(?=.*?[1-9]).*
- var str = user_string;
- if ('0' != str && str.matches(/^d{1,5}$/) {
- // code for match
- }
- var str = user_string;
- if (!str.matches(/^0+$/) && str.matches(/^d{1,5}$/) {
- // code for match
- }
- ^([1-9][0-9]{0,4}|[0-9]{,1}[1-9][0-9]{,3}|[0-9]{,2}[1-9][0-9]{,2}|[0-9]{,3}[1-9][0-9]|[0-9]{,4}[1-9])$
Add Comment
Please, Sign In to add comment