foxreplace
foxreplace copied to clipboard
Add if statements?
It would make the regex much more compact and convenient to write.
Can you provide a usage example so I can understand what you want exactly?
http://imgur.com/a/XaLm4
Ok, understood. I don't know if it's possible to implement, but it would certainly be very useful. Do you know if there is any actual implementation of this feature in any regex engine?
I'll copy your example here in text for easier access:
\I\N:A;
: If the nth capturing group was matched, then insert A.
\E:B;
: Else, insert B. Optional.
Example: /\bdog(s)?\b/i => dogg\I\1:ies;\E:y;
Will turn any instance of "dog" to "doggy" and "dogs" to "doggies".
It is actually a feature on Word Replacer 2, a Chrome extension.
I am currently using that extension but considering moving over to Fox Replace because the extension checks everything rather than just strings. I have thousands of replacements, which lags hard.
Ok, thanks. I have downloaded Word Replacer 2 to see how it implements this feature and others.