regex - Adding space after symbol if there doesn't already exist a space? -



regex - Adding space after symbol if there doesn't already exist a space? -

i need replace instances of commas in file there isn't space after comma.

for example, next needs change. this:

some function(int x,int y, int z) { // code }

to this:

some function(int x, int y, int z) { // code }

notice spaces after commas there wasn't space. how can apply 1,000+ line file of code using sublime?

use ctrl + h open search , replace, enable regular expression..

using negative lookahead:

find: ,(?!\s) replace: , ^ |___ space character

or basic regular expression:

find: ,([^\s]) replace: , \1

regex sublimetext2 sublimetext sublimetext3

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -