Hi I'm having an issue doing a simple numeric match, what am I doing wrong:
Criteria:
1) Always anchor to start
2) Always Numeric 6-7 digits
3) Always Followed by _ (underscore)
Sample: (want to match everything before LoremIpsum)
1212384_LoremIpsum...
1266625_LoremIpsum...
234233_LoremIpsum...
2348199_LoremIpsum...
I have tried a couple of things: (Does not Match)
^[\d]{6-7}_
^[0-9]{6-7}_
If I do:
^[\d]{6}_
^[0-9]{7}_
I get matches, why can't I do variable length in this expression ? What am I missing here ?
Thanks !
The correct syntax is with a comma:
{6,7}
Not:
{6-7}
Also, you don't have to put the \\d
in brackets:
^\d{6,7}_
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.