Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

API Editor Find/Replace using RegEx

1488121576
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
So, the API editor has added extraneous double spaces to the start of random lines in my scripts. While it has zero effect on the function of the script, I'd like to remove them all if possible. However going through several thousand lines of code to remove all of them manually is not really practical. I noticed that the script editor's find functionality allows you to search by RegEx, which is a great way to find the locations I want to replace, but it appears to be a very limited version of Regex, so for instance the following: (?:(\s\s\s\s))+\s\s finds all of the lines that have an extra '  ' in them perfectly, but the regex parser doesn't respect the non-matching group syntax, so when I go to replace the \s\s with emptiness, it replaces the whole match with the emptiness deleting the tabs as well as the spaces. Anyone know of a way to do this in the API editor or a free/cheap desktop editor that would allow me to do it? Thanks, Scott
1488124439
chris b.
Pro
Sheet Author
API Scripter
Notepad++ 's search and replace seems to be a fully featured regex, i think I used non capturing groups recently. I know i can use capture groups and use the group in the replace string.
1488125341
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Perfect, thanks Chris.