Search / Replace Expressions Question

M

msnyc07

I am trying to replace spaces with tabs where the format is something like

12.2121 19.2141
12.2121 19.2141

and I can't just search on 5 spaces and replace with tab because there are
other occurences of multiple spaces in the document so I need to pattern
match. I got this far

[0-9] [0-9][0-9].[0-9]

but am not sure what to put in replace.

I was hoping

[0-9]^t[0-9][0-9].[0-9]

meaning keep what was there but use tab instead which doesn't work. Pretty
sure there was a way to say ok now that you found the pattern, just replace
(this)

Any help appreciated.
 
M

msnyc07

Never mind thanks, answered my own question, for anyone who is curious;

Separate the three parts of the search with paretheses in order to identify
them;

([0-9])( )([0-9][0-9].[0-9])

then did replace as

/1^t/3

meaning use the first pattern as is, then add a tab, then use the 3rd part
as is. Nice stuff.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top