I'm leaving a message just to inquire about the Search/Replace function that you had made about a year ago. It's been a few months, and the feature seems to have stopped working. Is there a way I can fix it? Thanks in advance!
Hey! Long time no see indeed! The script should be working- are you using the VisualEditor? If you are I don't think it works yet. I've pretty much ceased develoment on it, but since I recently found how to fix a problem where it disappears if you switch from VE to source or source to VE and back to source mode, I'll probably make that fix soon. So basically"
yeah for VSTF you need to be 18+, do a lot of anti-vandal work, and then you can talk to staff about it when you feel like you're ready. The requirements for councilor are a lot less clear cut. I'd talk to Sarah and she can add you to the prospective list and they might eventually get back to you.
The first line deals with a special case that math found. It isn't pretty, and I intend to replace it with a function that checks for invalid regex soon. The second line breaks up the string, eg /a/ig into ["a", "ig"] which I can put into new RegExp The third line escapes the regex if #Sanitize is before the "regex"
It's not supposed to replace scope.its just supposed to be a lightweight way of doing replaces for people who know regex syntax. This by no means is aimed at most Wikians. As for sanitize, it just escapes the regex passed in if you put #sanitize before the regex.
At this point I don't know. I originally added #sanitize for me because I suck with regex, but I agree it's not perfect. You really don't need to use #sanitize though. You can just omit it and the program will work fine, it just won't escape the regex.
I have no idea what you guys are talking about, but I'm strongly against having the user enter regular expressions. That should be strictly optional. And if you do indeed want to add that option, don't allow the user to add complete regexes! Just the stuff between the delimiters.
In case you guys didn't know: There's this fancy shmancy new-fangled thing all the cool kids are using these days: It's called "checkbox". Checkboxes are really good for options. Or so the cool kids say.
Sorry, I figured suggesting a different approach to the regexes was related to what you were asking about in the first 3 lines of the evaluate function, like you said at the top.
Kangaroo can probably explain best, but my understanding was that this "scope terminal" is like "scope for the command line". The goal is to get rid of the UI (which would otherwise take up a considerable amount of space in the editor), and let advanced users just type their regexes directly in. Small target audience. Not intended for general use. It's considerably faster to use since you don't have to click a bunch of checkboxes or buttons in a UI. E.g. replace versus replaceAll — why have a checkbox for that option when you can just put the g modifier on your regex?
Also, Kangaroo may (hopefully) add an autodetect feature to detect whether the user entered a regex or wants to do a plain text replacement instead. Instead of manually escaping with #sanitize. Again, one less checkbox in the UI to have to interact with.
Ah, I see. So you've invented your own syntax. That's okay. I only suggested the above because that's what Perl - the granddaddy of regular expressions - does. There are two kinds of regular expressions in Perl - searching expressions and replacing expressions:
/search/modifiers for searches and s/search/replace/modifiers for replacements