# Unable to use regex to get substring from directory name

**URL:** https://community.mp3tag.de/t/unable-to-use-regex-to-get-substring-from-directory-name/46500
**Category:** Support
**Created:** [September 22, 2019, 5:08pm UTC](https://community.mp3tag.de/t/unable-to-use-regex-to-get-substring-from-directory-name/46500 "2019-09-22T17:08:22Z")
**Posts on this page:** 1
**Showing post:** 4

<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: [September 22, 2019, 5:53pm UTC](https://community.mp3tag.de/t/unable-to-use-regex-to-get-substring-from-directory-name/46500/4 "2019-09-22T17:53:41Z")

</div>

here is a statement about the flavour:

> [@What regex engine does mp3tag use?](https://community.mp3tag.de/t/what-regex-engine-does-mp3tag-use/6109/2):
>
> perl flavor to a large extent

> [@jerblack](#):
>
> Also, FYI, the regex you posted returns the entire string if there is no match

Yes, that is the way the regexp machine works in MP3tag

> [@jerblack](#):
>
> . I previously read the doc blurb you pointed to and did not see anything about quote requirements or why the regex behavior is different in mp3tag.

See the Help on scripting:  
**$regexp(x,expr,repl)** replaces the pattern specified by the [regular expression](https://docs.mp3tag.de/actions/replace-regexp) `expr` in the string `x` by `repl` . The fourth optional parameter enables ignore case (1) or disables the ignore case setting (0). Please note that you have to escape comma and other special characters in `expr` .

---

_[View the full topic](https://community.mp3tag.de/t/unable-to-use-regex-to-get-substring-from-directory-name/46500)._
