# Regex help! :)

**URL:** https://community.mp3tag.de/t/regex-help/11734
**Category:** Support
**Created:** [March 17, 2011, 1:15am UTC](https://community.mp3tag.de/t/regex-help/11734 "2011-03-17T01:15:06Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Harakiri](https://community.mp3tag.de/user_avatar/community.mp3tag.de/harakiri/32/142_2.png) [@Harakiri](https://community.mp3tag.de/u/Harakiri)
#### Post date: [March 17, 2011, 1:15am UTC](https://community.mp3tag.de/t/regex-help/11734/1 "2011-03-17T01:15:06Z")

</div>

Hi!

I'm using FoxReplace Firefox extension to enhance forum usage such as creating BBCODE image lists.

Abstractly speaking i have:

```
http(s)://content.domain/image.ext

```

I want to covert it to:

```
[img]http(s)://content.domain/image.ext[/img]

```

I've found this Regex line that i believe it satisfies the condition but i can't make it to work:

```
(http(s?):)|([/|.|\w|\s])*\.(?:jpg|gif|png)

```

I believe this one isn't easy to figure out, any tips or suggestions will be immensely appreciated! 🙂

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [March 17, 2011, 5:04am UTC](https://community.mp3tag.de/t/regex-help/11734/2 "2011-03-17T05:04:58Z")

</div>

> [@Harakiri](#):
>
> ...I'm using FoxReplace Firefox extension to enhance forum usage such as creating BBCODE image lists....

What does this HTML code have to do with tagging MP3 files?

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [March 17, 2011, 6:19am UTC](https://community.mp3tag.de/t/regex-help/11734/3 "2011-03-17T06:19:43Z")

</div>

> [@Harakiri](#):
>
> ... I've found this Regex line that i believe it satisfies the condition but i can't make it to work:
> 
> ```
> (http(s?):)|([/|.|\w|\s])*\.(?:jpg|gif|png)
> 
> ```
> 
> I believe this one isn't easy to figure out, any tips or suggestions will be immensely appreciated! 🙂

I've just found this article about regular expression to detect an URL:  
[http://www.regexguru.com/2008/11/detecting...-block-of-text/](http://www.regexguru.com/2008/11/detecting-urls-in-a-block-of-text/)  
Maybe it can help you to create your own.

DD.20110317.0820.CET

---

<div class="post-metadata">

### Author: ![ganjaman](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/bbe5ce/32.png) [@ganjaman](https://community.mp3tag.de/u/ganjaman)
#### Post date: [March 17, 2011, 9:32am UTC](https://community.mp3tag.de/t/regex-help/11734/4 "2011-03-17T09:32:35Z")

</div>

I've found this website useful when playing around with Regexs

[http://gskinner.com/RegExr/](http://gskinner.com/RegExr/)

---

<div class="post-metadata">

### Author: ![Harakiri](https://community.mp3tag.de/user_avatar/community.mp3tag.de/harakiri/32/142_2.png) [@Harakiri](https://community.mp3tag.de/u/Harakiri)
#### Post date: [March 17, 2011, 12:13pm UTC](https://community.mp3tag.de/t/regex-help/11734/5 "2011-03-17T12:13:41Z")

</div>

Thank you all for the tips!

Kudos goes to ganjaman for introducing me to such a fine tool! It will work as my regex swissknife from now on! 🙂

I kinda figured out the regex and the respective result (FoxReplace):

```
(((http://www)|(http://)|(www)|(https://))[-a-zA-Z0-9@:%_\+.~#?&//=]+)
\.(jpg|jpeg|gif|png|bmp|tiff|tga|svg)

```

Replace matches with:

```
[img]$1.$7[/img]

```

Worked as a charm! 🙂

---

<div class="post-metadata">

### Author: ![Harakiri](https://community.mp3tag.de/user_avatar/community.mp3tag.de/harakiri/32/142_2.png) [@Harakiri](https://community.mp3tag.de/u/Harakiri)
#### Post date: [March 17, 2011, 12:23pm UTC](https://community.mp3tag.de/t/regex-help/11734/6 "2011-03-17T12:23:45Z")

</div>

> [@ohrenkino](#):
>
> What does this HTML code have to do with tagging MP3 files?

Countless other programs take advantage of regular expressions besides Mp3Tag. Since there are many people interested about improving their knowledge like me i decided to share the challenge! 🙂

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [March 17, 2011, 1:24pm UTC](https://community.mp3tag.de/t/regex-help/11734/7 "2011-03-17T13:24:48Z")

</div>

QUOTE (Harakiri @ Mar 17 2011, 14:13) \<{POST\_SNAPBACK}\>

... I kinda figured out the regex and the respective result (FoxReplace):

```
(((http://www)|(http://)|(www)|(https://))[-a-zA-Z0-9@:%_\+.~#?&//=]+)
\.(jpg|jpeg|gif|png|bmp|tiff|tga|svg)

```

Replace matches with:

```
[img]$1.$7[/img]

```

Worked as a charm! 🙂

I have tried your regular expression with Mp3tag ...

**$regexp(%URL%,'(((http://www)|(http://)|(www)|(https://))[-a-zA-Z0-9@:%\_\+.~#?&//=]+)\.(jpg|jpeg|gif|png|bmp|tiff|tga|svg)','(.img.)$1.$7(./img.)')**

(Note: Replaced square brackets around IMG BBCODE tags with "(." resp. ".)" to display it here.)

... with the URL ...  
**[http://forums.mp3tag.de/style\_emoticons/default/smile.gif](http://forums.mp3tag.de/style_emoticons/default/smile.gif)**  
and it seems to work ...  
 ![](http://forums.mp3tag.de/style_emoticons/default/smile.gif)

Please offer the public reference (the BBS) where do you apply this functionality.

DD.20110317.1545.CET

---

<div class="post-metadata">

### Author: ![Harakiri](https://community.mp3tag.de/user_avatar/community.mp3tag.de/harakiri/32/142_2.png) [@Harakiri](https://community.mp3tag.de/u/Harakiri)
#### Post date: [March 18, 2011, 1:53am UTC](https://community.mp3tag.de/t/regex-help/11734/8 "2011-03-18T01:53:14Z")

</div>

Let's say you want to copy all image links from this site with the least possible effort:

[🙂](http://www.stancenation.com/forum/viewtopic.php?f=5&t=2319)

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [March 18, 2011, 2:29am UTC](https://community.mp3tag.de/t/regex-help/11734/9 "2011-03-18T02:29:40Z")

</div>

> [@Harakiri](#):
>
> Let's say you want to copy all image links from this site with the least possible effort: ...

If I need such functionality, then I use simply my text editor or when just using IE with installed developer tools, press F12, and let me give a link report.

Hmm ... I do not see any relevance to Music and Mp3tag.

It is no good practice for this board to offer picture references pointing to the webpages of other providers. In case of the link will become broken, the image is lost here in the board's article.

Illustrative images should be glued together for ever with the article on this board.  
So pictures need to be stored permanently by uploading to this board's server.

DD.20110318.0430.CET

---

<div class="post-metadata">

### Author: ![Harakiri](https://community.mp3tag.de/user_avatar/community.mp3tag.de/harakiri/32/142_2.png) [@Harakiri](https://community.mp3tag.de/u/Harakiri)
#### Post date: [March 18, 2011, 2:41am UTC](https://community.mp3tag.de/t/regex-help/11734/10 "2011-03-18T02:41:56Z")

</div>

I always thought there was some flexibility to share information regarding regex with Mp3Tag community. I can remove the topic or upload the GIFs to the boards, your call.

---

<div class="post-metadata">

### Author: ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)
#### Post date: [March 18, 2011, 9:21pm UTC](https://community.mp3tag.de/t/regex-help/11734/11 "2011-03-18T21:21:12Z")

</div>

this topic is clearly off-topic, for which there would be a extra forum here.

if you want to download all images of a webpage, i recommend you a software called JDownloader. It's a download manager with lots of possiblilities.  
You can just copy the whole source code of the page and JDownloader will extract all picture URLs for you.

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:22pm UTC](https://community.mp3tag.de/t/regex-help/11734/12 "2026-02-09T12:22:59Z")

</div>


