> For the complete documentation index, see [llms.txt](https://notes.programmersecurity.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.programmersecurity.com/ctfs/regex-bypass.md).

# Regex Bypass

## Regex101

If we want to bypass a regex, first we need to understand it. for that i will be going to use the below link

{% embed url="<https://regex101.com/>" %}

lets say we have the following regex&#x20;

```python
^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$
```

i will paste this to **regex101** and try to understand it

<figure><img src="/files/eYuZiYCrbHBAgBznDXEt" alt=""><figcaption></figcaption></figure>

now i will try to add a random email address to see wether i can bypass the regex or not, and i can see that my email has been caught by the regex

<figure><img src="/files/QZ4iWmIz6IGg97bheF87" alt=""><figcaption></figcaption></figure>

now i will try to bypass it using the following email

```python
jjjjjjjjjjjjjjjjjjjjjjjjjjjj@ccccccccccccccccccccccccccccc.55555555555555555555555555555555555555555555555555555555.
```

<figure><img src="/files/NAVUsxqouz4W3pUPwOdr" alt=""><figcaption></figcaption></figure>

and now regex has been bypassed

## JEX.IM

We can use the Second website to understand the regex

{% embed url="<https://jex.im/regulex/>" %}

so i can paste the same regex used above and understand it

<figure><img src="/files/M8AQ7USgMUKsspUp2Epm" alt=""><figcaption></figcaption></figure>
