# Computing - Regular Expressions

> Source: https://ollybritton.com/notes/a-level/computing/topics/regular-expressions/ · Updated: 2021-01-11 · Tags: computing, regular-languages, school

##### ![PHOTO REGEX AB](regex-ab.png) What regular expression is this??
$$
ab
$$

##### ![PHOTO REGEX A|B](regex-a-or-b.png) What regular expression is this??
$$
a|b
$$

##### ![PHOTO REGEX A+](regex-a-plus.png) What regular expression is this??
$$
a+
$$

##### ![PHOTO REGEX A*](regex-a-star.png) What regular expression is this??
$$
a*
$$

##### Visualise the finite state machine for $ab$??
![PHOTO REGEX AB](regex-ab.png)

##### Visualise the finite state machine for $a|b$??
![PHOTO REGEX A|B](regex-a-or-b.png)

##### Visualise the finite state machine for $a+$??
![PHOTO REGEX A+](regex-a-plus.png)

##### Visualise the finite state machine for $a*$??
![PHOTO REGEX A*](regex-a-star.png)

##### What is the precedence for regular expressions??
* `()`
* `*`
* `+`
* `?`
* `|`

---
Olly Britton — https://ollybritton.com. Machine-readable index: https://ollybritton.com/llms.txt
