
Looks like I can match a word without capturing by doing (?:) So I can just swap out the if for this and it'll work better.

I can accomplish this for a single case at a time like so:įor spaces first: Find: space*if Replace: if This only works for lines with no tabs and where the first word is if so I would do this for the starting word of the line. If you need any more information or details please ask I'll respond as quickly as I can. If you could also explain how your regex works it would be very much appreciated as I'm trying to learn how to do my own regex instead of always asking others to do it. If there are 4 spaces in a row it should be converted to a tab instead. The regex command should keep the correct number of tabs and just remove the spaces. It should not affect anything after the first word, so only the indentation will be affected: So tab space if space boolean should be changed to tab if space boolean not tab if tab boolean.

I'd like to be able to fix a Text File's tabs/spaces indentation.Ĭurrently each line has spaces in random locations for some reason.
