Alternatives and Grouping
A set of alternative patterns can be specified with the | symbol:
/wolf|sheep/; # matches "wolf" or "sheep"
Use parenthesis with alternative patterns:
/big bad (wolf|sheep)/; # matches "big bad wolf" or "big bad sheep"
- Create a regular expression that will match a string with this pattern ATG followed by a C or a T. Test your regular expression with these two strings: