How to specify a regular expression?

Good time of day) Could please help with a regular expression) Need to get a two-digit number ( example ab) or b is unambiguous in range and would include only numbers from 0 to 7 ; the range b - only numbers - 0,2,3,6. In the end it should come out for example as follows - 00, 02, 70, 32, 76, 16, 0, 2, 3, 6 thanks in Advance
April 3rd 20 at 18:39
1 answer
April 3rd 20 at 18:41
Expression:
^(?:[0-7][01236]|[0236])$
Check

Not entirely clear what you want and why you need it, even taking into account the clarifications in the comments. But I hope you will be able to understand the structure of expressions and do similar what you need.

Now the structure of the expression is this: there is a check separately by a two-digit number and separately in single digits (separated by "|"). Can choose to double, what ranges of numbers should be. And also separately for clear can also define ranges.

If you want to check for regex101.com by clicking on the link, enter the number in the new row every time because the characters "^" and "$" represent the beginning and the end of the row. Actually, if they are not needed can be removed, but then will most likely need something else. That is, if you need to pull these values from a string, the problem would be stuck in the number (two unambiguous in a row without a space) and other situations - need to resolve separately.

Find more questions by tags Regular expressions