# HyperTTS - RegEx rule is unable to filter images

**URL:** <https://forums.ankiweb.net/t/hypertts-regex-rule-is-unable-to-filter-images/28825>\
**Category:** Add-ons\
**Created:** [March 27, 2023, 11:33pm UTC](https://forums.ankiweb.net/t/hypertts-regex-rule-is-unable-to-filter-images/28825 "2023-03-27T23:33:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cafelinked](https://avatars.discourse-cdn.com/v4/letter/c/839c29/32.png) [@cafelinked](https://forums.ankiweb.net/u/cafelinked)\
**Post date:** [March 27, 2023, 11:33pm UTC](https://forums.ankiweb.net/t/hypertts-regex-rule-is-unable-to-filter-images/28825/1 "2023-03-27T23:33:11Z")

</div>

I am trying to add a RegEx rule into HyperTTS. Unfortunately, I am unable to filter images.  
Let’s say I am using Cloze deletion cards, and the image itself is a cloze deletion. On generating the audio for collection (not real time), the image file name gets audioed which should not occur ideally. For example:

`><div>The best spaced-repetition software available to use is {{c1::Anki<br><img src="anki.jpg">}}</div>`

In the real-time audio generation, the image file name (in this case “anki.jpg”) does not get placed into the TTS. However, in the Audio Collection, this name gets generated. So I tried to add a RegEx rule:

`<img src=".*?\.jpg">`

But this still generates the audio for the file name “anki.jpg” Not too sure what I am doing wrong…

---

<div class="post-metadata">

**Author:** ![cafelinked](https://avatars.discourse-cdn.com/v4/letter/c/839c29/32.png) [@cafelinked](https://forums.ankiweb.net/u/cafelinked)\
**Post date:** [March 29, 2023, 6:35am UTC](https://forums.ankiweb.net/t/hypertts-regex-rule-is-unable-to-filter-images/28825/2 "2023-03-29T06:35:01Z")

</div>

After much editing, I figured the best solution were the following codes for RegEx Rules to filter out all images:

`\w*-\d*\.jpg`

I realized I could just use `\w*` or `\d*` where `w` indicates any characters, and `d` indicates any digits, followed by `*` to indicate any number of characters. It took some time, but I got it to work. I also used the following RegEx (for png, bmp, gif, tiff, and jpeg files, same rules were applied but with different endings):

```auto
\w*\d*\.jpg
\d*\w*\.jpg
\w*_\d*\.jpg
\d*_\w*\.jpg

```
