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
So I want to generate a random expression that does not contain a certain combination of characters. For example, let's imagine that I want to generate 2-character words with the letters 'a' and 'b' such that I can generate:
'aa'
'ab'
'ba'
'bb'
Then I want the generator to avoid generating one of those words, for instance 'aa', for which I created the following Regular Expression:
/((?!aa)[a-b]){2}/
However, a randexp based on this Regular Expression will be generating all of the words listed above, including 'aa' which is supposed to be skipped.
Isn't this considered by the algorithm? Is there something wrong with my Regular Expression? Or is there a bug in the algorithm?
Thanks in advance.
The text was updated successfully, but these errors were encountered:
So I want to generate a random expression that does not contain a certain combination of characters. For example, let's imagine that I want to generate 2-character words with the letters 'a' and 'b' such that I can generate:
'aa'
'ab'
'ba'
'bb'
Then I want the generator to avoid generating one of those words, for instance 'aa', for which I created the following Regular Expression:
/((?!aa)[a-b]){2}/
However, a
randexp
based on this Regular Expression will be generating all of the words listed above, including 'aa' which is supposed to be skipped.Isn't this considered by the algorithm? Is there something wrong with my Regular Expression? Or is there a bug in the algorithm?
Thanks in advance.
The text was updated successfully, but these errors were encountered: