# 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="https://3420091786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1ZUO45eHY8aMCLJ7OiN%2Fuploads%2Fvv29RP2UEsIHpnBJSbmw%2Fimage.png?alt=media&#x26;token=03491328-3399-4c1e-a30d-05474e14762b" 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="https://3420091786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1ZUO45eHY8aMCLJ7OiN%2Fuploads%2FowygSR3Ys6XbcHlNPHfL%2Fimage.png?alt=media&#x26;token=bf3714e0-f6a9-41c2-a469-478ce13c250d" alt=""><figcaption></figcaption></figure>

now i will try to bypass it using the following email

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

<figure><img src="https://3420091786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1ZUO45eHY8aMCLJ7OiN%2Fuploads%2FU1xDso5gsTxUKaI4QEfl%2Fimage.png?alt=media&#x26;token=c0743731-f76b-4ec8-bbd9-a7aa51401656" 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="https://3420091786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1ZUO45eHY8aMCLJ7OiN%2Fuploads%2FPwtAaKjejaGXWmHIVz8P%2Fimage.png?alt=media&#x26;token=df1433f7-8874-4bdc-9a5f-624257e5aeb2" alt=""><figcaption></figcaption></figure>
