Replace spaces with dashes

A swapping-ground for Regular Expression syntax

Replace spaces with dashes

Postby OhEddie » Thu Jun 09, 2011 3:29 pm

I find it easy to replace characters with other characters, but when the character is a "nothing", aka a "space", I have had no luck figuring it out.
I have searched the forums and read the manual, and played with the program, however, I have been unable to replace the spaces between multiple words with dashes.

I would like this ... xxx yyy zzz, to become this... xxx-yyy-zzz

Thanks for your help.
OhEddie
 
Posts: 1
Joined: Thu Jun 09, 2011 3:22 pm

Re: Replace spaces with dashes

Postby Stefan » Thu Jun 09, 2011 10:27 pm

OhEddie wrote:I find it easy to replace characters with other characters, but when the character is a "nothing", aka a "space", I have had no luck figuring it out.
I have searched the forums and read the manual, and played with the program, however, I have been unable to replace the spaces between multiple words with dashes.

I would like this ... xxx yyy zzz, to become this... xxx-yyy-zzz

Thanks for your help.

To replace an space by an other char do the same as with replacing an char with an other char.
There is no differences, only the "char" is an space sign here.


Example

FROM
xxx yyy zzz

TO:
xxx-yyy-zzz

USE:

Repl.(3)
Replace: "#"
With: "-"


(note: don't use the quotes "...", they are only to make it more clear)

(note:instead of "#" insert an single blank by pressing the space bar while the cursor is in the "Replace" box)
Repl.(3)
Replace: " "
With: "-"
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU


Return to Regular Expressions