> 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>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://notes.programmersecurity.com/ctfs/regex-bypass.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
