Regex for 7-10 integers
I have another question today. I have an email appliance that I am setting
up to filter certain data, but it can only do this via regular expression.
I have this partially accomplished thanks to this fine gentleman. What I
need to accomplish now is something a bit more complex. I should add that
I am a complete novice at regex. Right now i'm using this:
(?<!\d)(?!1000000)([1-7]\d{6}|8000000)(?!\d)
To find 7 digit integers within a range from 1000001 to 8000000, what i'm
looking to do now is find integers between 1000000 and 12000000000, I can
re purpose this code by simply changing up the section here
([1-7]\d{6}
But from my understanding this would require I format 5 separate
expressions to find the data I need (I may be completely off base about
this, but I don't know enough about regex to change this line to what I
need). I would prefer one expression to look for data between 7-12 digits
and stop at certain explicit 12 digit value. How can I accomplish this?
No comments:
Post a Comment