# regexp

**URL:** https://community.mp3tag.de/t/regexp/8284
**Category:** Support
**Created:** [April 23, 2009, 12:34pm UTC](https://community.mp3tag.de/t/regexp/8284 "2009-04-23T12:34:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [April 23, 2009, 12:34pm UTC](https://community.mp3tag.de/t/regexp/8284/1 "2009-04-23T12:34:03Z")

</div>

Can anoyone suggest a script expression to remove everything from a string except (one or more) four-digit numbers?

---

<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: [April 23, 2009, 12:45pm UTC](https://community.mp3tag.de/t/regexp/8284/2 "2009-04-23T12:45:42Z")

</div>

Example to find one occurence:  
$regexp('xxx 4711 xxx','._(\d\d\d\d)._',$1) ==\> '4711'

DD.20090423.1645.CEST

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [April 23, 2009, 12:52pm UTC](https://community.mp3tag.de/t/regexp/8284/3 "2009-04-23T12:52:21Z")

</div>

Thanks, but fails on e.g.

$regexp('xxx 4711 9999 xxx','._(\d\d\d\d)._',$1) --\> [only] 9999

---

<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: [April 23, 2009, 1:02pm UTC](https://community.mp3tag.de/t/regexp/8284/4 "2009-04-23T13:02:08Z")

</div>

Try this:

```
$regexp($regexp($regexp($regexp('xxx 4711 x1x12xx123xxx 1234','[^\d]',' '),' \d{1,3} ',),' {1,}', ),'^ ',)
==> '4711 1234'

```

DD.20090423.1702.CEST

---

<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:21pm UTC](https://community.mp3tag.de/t/regexp/8284/5 "2026-02-09T12:21:30Z")

</div>


