# Need some RegExp help

**URL:** https://community.mp3tag.de/t/need-some-regexp-help/12882
**Category:** Web Sources Discussion
**Created:** [December 30, 2011, 1:50pm UTC](https://community.mp3tag.de/t/need-some-regexp-help/12882 "2011-12-30T13:50:55Z")
**Posts on this page:** 2
**Page:** 1

<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: [December 30, 2011, 1:50pm UTC](https://community.mp3tag.de/t/need-some-regexp-help/12882/1 "2011-12-30T13:50:55Z")

</div>

I got a personal message from ra7h35m20s, Yesterday, 10:28, and pull it up into common Web Sources Discussion.

> [@](#):
>
> I am trying to find a way to replace spaces with hypens in a script I am working on. The URL looks like this now ....
> 
> [http://itunes.apple.com/us/album/From](http://itunes.apple.com/us/album/From) the End/id366507575
> 
> But I need it to look like this....
> 
> [http://itunes.apple.com/us/album/From-the-End/id366507575](http://itunes.apple.com/us/album/From-the-End/id366507575)
> 
> I worked out a simple RegExp that formats the input correctly in the Search dialog box however, I am not able to set up that same functionality for it to work in the script ....
> 
> Here is the script portion....
> 
> # URL
> 
> say "[http://itunes.apple.com/us/album/](http://itunes.apple.com/us/album/)"  
> findline "wrapperType""  
> findinline ""collectionName":""  
> sayregexp "("collectionName":") (\s\*-)"  
> sayuntil """  
> say "/id"  
> findline "wrapperType""  
> findinline ""collectionId":"  
> sayuntil ","  
> say "|"
> 
> Any advice would be greatly appreciated.

Hmm ... this is not a correct URL ...  
[http://itunes.apple.com/us/album/From](http://itunes.apple.com/us/album/From) the End/id366507575  
... should be written as ...  
[http://itunes.apple.com/us/album/From%20th...End/id366507575](http://itunes.apple.com/us/album/From%20the%20End/id366507575)  
... to be used in the address line of a browser.

To change the space character resp. its hexadecimal representation to hyphen character, use a function $replace or $regexp.

I do not understand what the 'script portion' has to do with the URL and what you want to achieve within your websource script.  
Others?

DD.20111230.1549.CET

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [December 30, 2011, 2:15pm UTC](https://community.mp3tag.de/t/need-some-regexp-help/12882/2 "2011-12-30T14:15:11Z")

</div>

I think this replacement is not needed because the url with hyphens is available in the "collectionViewUrl" key.
