Example: there must be at least two digits in a given string independent of their position.
This will only work IF THEY ARE TOGETHER: /[0-9]{2}/
If they are separated like a1b2 it doesn’t work.
EDIT: Thanks for the responses, but I realise this example was too trivial. Try this instead: there must be at least two digits in a given string AND two of the letter x AND two of the character & AND two of the letter J.
Wouldn’t adding .* between every possible permutation get really lengthy? is there no way to not be concerned about the order?
Well yes since you have more rules for your regex it will get more lengthy. This is inevitable. In general when you want to check if there is at least something you should use positive lookahead assertions :
This account for at least two digits and at least two x’s. The rest I leave it to you.