# RegExp to extract text before first comma

**URL:** https://community.mp3tag.de/t/regexp-to-extract-text-before-first-comma/57083
**Category:** General Discussion
**Tags:** howto
**Created:** [April 19, 2022, 9:45pm UTC](https://community.mp3tag.de/t/regexp-to-extract-text-before-first-comma/57083 "2022-04-19T21:45:08Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [April 20, 2022, 6:23am UTC](https://community.mp3tag.de/t/regexp-to-extract-text-before-first-comma/57083/2 "2022-04-20T06:23:20Z")

</div>

> [@EricB](#):
>
> |`\{002c}`|up to first comma (comma must be escaped or Unicode)

This is not quite true if you use  
`$regexp(%composer%,'^(.+?),.*',$1)`  
instead  
The potential section following the comma does not necessarily need the parenthesis if you do not want to use it anyway, so $2 is not mandatory.  
... but there are so many ways to solve the problem.

---

_[View the full topic](https://community.mp3tag.de/t/regexp-to-extract-text-before-first-comma/57083)._
