# Can't Get \[A-Z\] To Work With Regex

**URL:** <https://community.mp3tag.de/t/cant-get-a-z-to-work-with-regex/41569>\
**Category:** Support\
**Created:** [April 28, 2018, 9:16pm UTC](https://community.mp3tag.de/t/cant-get-a-z-to-work-with-regex/41569 "2018-04-28T21:16:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lampshade](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/858c86/32.png) [@lampshade](https://community.mp3tag.de/u/lampshade)\
**Post date:** [April 28, 2018, 9:16pm UTC](https://community.mp3tag.de/t/cant-get-a-z-to-work-with-regex/41569/1 "2018-04-28T21:16:36Z")

</div>

I'm trying to use a "Format Value" action to change the filename. %artist% contains the phrase "Artist Name".

If I use `$regexp(%artist%,\u,_)` I get `_rtist _ame.flac` as expected.  
If I use `$regexp(%artist%,[A-Z],_)` I get `_A_r_t_i_s_t_ _N_a_m_e_.flac`.  
No idea what I'm doing wrong, can anyone help?

In the end I'd like to to change all characters to underscores except A-Z, a-z, 0-9 and spaces. I'm trying to write this regular expression because if I use \W it doesn't change characters like ö.

EDIT:

Never mind! I was lying awake in bed at 5.15 this morning thinking about it and I suddenly realised I need to escape the square brackets '['. Phew! Thanks to anyone who read my post 🙂

---

<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:27pm UTC](https://community.mp3tag.de/t/cant-get-a-z-to-work-with-regex/41569/2 "2026-02-09T12:27:24Z")

</div>


