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
Post a Comment