You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The limit argument allows me to set a maximum length for the returned string, but i have no way to set the minimum. I attempted to use a forward lookahead in the regex pattern, but it seems like it is ignored.
^(?=.{12,16}$)(9*)$
So that should give me strings with a minimum length of 12 and maximum length of 16 made up of 9s. When i run this it spits out a whole lot of random stuff. If i take away the lookahead, it correctly gives me the 9s
^(9*)$
If lookaheads or lookbehinds are not the right way to set string minimums, what is? If they are the correct way, what is going wrong with exrex?
EDIT: I should note that my desired regex pattern is quite a bit more involved than a bunch of 9s, I am just using it here as a simplified example for setting minimum lengths. My desired pattern for which i wish to set a minimum length is
The limit argument allows me to set a maximum length for the returned string, but i have no way to set the minimum. I attempted to use a forward lookahead in the regex pattern, but it seems like it is ignored.
^(?=.{12,16}$)(9*)$
So that should give me strings with a minimum length of 12 and maximum length of 16 made up of 9s. When i run this it spits out a whole lot of random stuff. If i take away the lookahead, it correctly gives me the 9s
^(9*)$
If lookaheads or lookbehinds are not the right way to set string minimums, what is? If they are the correct way, what is going wrong with exrex?
EDIT: I should note that my desired regex pattern is quite a bit more involved than a bunch of 9s, I am just using it here as a simplified example for setting minimum lengths. My desired pattern for which i wish to set a minimum length is
^(2{0,1}3{0,1}4{0,1}6{0,1}7*8*9*|3{0,1}5{0,1}7*9*)$
The text was updated successfully, but these errors were encountered: