# Crawler Regex help

**URL:** <https://discuss.elastic.co/t/crawler-regex-help/295480>\
**Category:** Elastic Search\
**Created:** [January 26, 2022, 3:56pm UTC](https://discuss.elastic.co/t/crawler-regex-help/295480 "2022-01-26T15:56:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ansamHox](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@ansamHox](https://discuss.elastic.co/u/ansamHox)\
**Post date:** [January 26, 2022, 3:56pm UTC](https://discuss.elastic.co/t/crawler-regex-help/295480/1 "2022-01-26T15:56:58Z")

</div>

I need help creating Regex rules for Crawler, because it seems that regex is not working as it should.

I don't want to crawl anything in` /wp-content/uploads` folders, (images, media, etc.).

I tried to set regex to: DISALLOW - REGEX - `.*/wp-content/uploads.*`  
Also tried regex to ignore all Image extensions I have: ` /\.(gif|jpe?g|tiff?|png|webp|bmp)$/i`

Without any luck, it's all being processed again. How can I achieve this?

---

<div class="post-metadata">

**Author:** ![Sean\_Story](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_story/32/69987_2.png) [@Sean\_Story](https://discuss.elastic.co/u/Sean_Story)\
**Post date:** [February 1, 2022, 9:46pm UTC](https://discuss.elastic.co/t/crawler-regex-help/295480/2 "2022-02-01T21:46:18Z")

</div>

Hi @ansamHox ,

Take a look over the [crawl rules documentation](https://www.elastic.co/guide/en/app-search/current/web-crawler-reference.html#web-crawler-reference-crawl-rule-rules). Specifically, these regexes must follow the Ruby Regex syntax. When I added your rules to [https://rubular.com/](https://rubular.com/), it immediately identified some syntax issues.

For your image regex specifically, also note this block from the docs:

> The rule matches when the _path pattern_ matches the **beginning** of the _path_ (which always begins with `/` ).

Which means you probably need a preceding `.*`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2022, 8:33am UTC](https://discuss.elastic.co/t/crawler-regex-help/295480/3 "2022-11-04T08:33:57Z")

</div>


