# How to strip everthing other than a word in line?

**URL:** https://community.mp3tag.de/t/how-to-strip-everthing-other-than-a-word-in-line/6973
**Category:** Web Sources Discussion
**Created:** [June 26, 2008, 7:21am UTC](https://community.mp3tag.de/t/how-to-strip-everthing-other-than-a-word-in-line/6973 "2008-06-26T07:21:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![itsalok4u](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/e47c2d/32.png) [@itsalok4u](https://community.mp3tag.de/u/itsalok4u)
#### Post date: [June 26, 2008, 7:21am UTC](https://community.mp3tag.de/t/how-to-strip-everthing-other-than-a-word-in-line/6973/1 "2008-06-26T07:21:01Z")

</div>

i.e "Movie Name : Chameli (2004) Singer : Sunidhi Chauhan Music Director : Sandesh Shandilya"

Is it possible to extract "Sunidhi Chauhan" out of this Line and put it in the "Artist" tag with the parser of mp3tag?

I cannot use FindInLine command as Singer is not always returned by the server. So FindInLine Command error outs. So all i can do is strip out the unwanted data whenever Singer info is returned.

I am trying this command regexpreplace "^[^S]+" "" which removes everthing before "Singer" if the movie name does not start with "S"

How do I modify this regex to strip everything before only if the word is Singer?

What about striping everything on and after "Music Director"?

Please help as I am very close to making the first script that will help anybody looking to tag Indian Music.

any help is much appreciated.

---

<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: [June 26, 2008, 8:09am UTC](https://community.mp3tag.de/t/how-to-strip-everthing-other-than-a-word-in-line/6973/2 "2008-06-26T08:09:58Z")

</div>

> [@Alok](#):
>
> ...Is it possible to extract "Sunidhi Chauhan" out of this Line and put it in the "Artist" tag with the parser of mp3tag?...

As a starting point:

```
$regexp(Movie Name : Chameli (2004) Singer : Sunidhi Chauhan Music Director : Sandesh Shandilya,Movie Name : (.+?) Singer : (.+?) Music Director : (.+),$2)

```

gives 'Sunidhi Chauhan'.

DD.20080626.1210.CEST

---

<div class="post-metadata">

### Author: ![itsalok4u](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/e47c2d/32.png) [@itsalok4u](https://community.mp3tag.de/u/itsalok4u)
#### Post date: [June 28, 2008, 8:06pm UTC](https://community.mp3tag.de/t/how-to-strip-everthing-other-than-a-word-in-line/6973/3 "2008-06-28T20:06:48Z")

</div>

> [@DetlevD](#):
>
> As a starting point:
> 
> ```
> $regexp(Movie Name : Chameli (2004) Singer : Sunidhi Chauhan Music Director : Sandesh Shandilya,Movie Name : (.+?) Singer : (.+?) Music Director : (.+),$2)
> 
> ```
> 
> gives 'Sunidhi Chauhan'.
> 
> DD.20080626.1210.CEST

Thx a lot. Got it working. Basically this is what I did if anyone else is interested.

```
#Artist(S)
MoveLine -1
MoveLine +1
killtag "*"
regexpreplace "^(\s)" ""
regexpreplace " (.+?) " ""
regexpreplace "Singer(.+)" "Singer"
regexpreplace "(.+?)Singer" "Singer"
outputto "Artist"
if "Singer"
        MoveLine -1
        MoveLine +1
        killtag "*"
        if " Singer"
            regexpreplace "Singer : " ""
        else
            regexpreplace "(.+?) Singer : " ""
        endif
        regexpreplace " (.+)" ""
        if " ,"
            MoveChar 4
        endif
        sayrest
        Say "|"
else
        Say "|"
endif

```

This will output anything in between Singer : and Music Director : if Singer exists.
