-2

I am new to sublime text3 but started to like working in it.

I am using its search and replace to achieve as below:

I have a list of hundreds of items like the below :

5149 : Kaliana
5427 : Kalo Chorio
5036 : Kalo Chorio Kapouti
5071 : Kalo Chorio Sleas
5466 : Kalopanagiotis

But I want to replace these with

5149-
5427-
5036-
5071-
5466-

So basically the colon and the words should be replaced by a hyphen(-) symbol

I tried few regular expressions. for example : (?<=WORD).*$

but things aren't working.

  • Possible duplicate of [Regular expression search replace in Sublime Text 2](https://stackoverflow.com/questions/11819886/regular-expression-search-replace-in-sublime-text-2) – linuxUser123 May 20 '19 at 10:58
  • The way the problem is described and question is phrased it is unlikely going to contribute any value to SO. Next time divide and conquer your problem. – linuxUser123 May 20 '19 at 11:01

1 Answers1

0

I tried myself and finally got the expression that works for my requirement.

In the find area type:

 : [a-zA-Z\d" "]+

And in the replace area type:

-

This gives you the numbers followed by a hiphen and eliminating the words.