there should be at least 6 alphanumeric characters
and there should be two consecutive digits somewhere in the string - the \w* in front is to make sure that the digits can be anywhere, if it was just (?=\d{2}) they could have been only at the beginning
So correct me if I’m wrong here, everytime there is a condition to be met it means there must be another lookahead, am I right or wrong or how does one judge just how many lookouts there can/should be?
it depends on the pattern, if you have two different conditions that can’t be easily satisfied with the same pattern you could use a lookahead + normal patter or just lookaheads. Sometimes the conditions can be actually expressed with a single pattern. It depends on the situation.
Another question that has been puzzling me for a while now…why not use the wild card instead of the “w” in this example…or CAN I and the return will still be the same?
it depends on what kind of characters you are allowing, but considering that the other lookahead uses \w, you can use . in this one and there shouldn’t be much difference, but it can have different effects for strings that have the numbers more forward in the string
I don’t understand what you mean by the other lookahead, are you saying that if one . is used that . can’t be used again (. can only be used once)? (provided that . is used in the place of first \w)
no, I mean that . means any character, so it would not give any limits on what characters can be used, but \w instead matches only a limited set of characters
the other lookahead uses \w so there is already a limitation on which characters are allowed