CR4SH3D wrote:something like spliff is still picked up as if by auto complete (make the check string "if " i think to fix it?)
Does C# have regular expressions? If so, the check should probably be "(nonalphanumeric)if(nonalphanumeric)" (with (nonalphanumeric) replaced with the right escape code.)
If not, how about looking for " if " (but \n and \t have to be replaced by " " in a temporary string).
Certainly, but that parsing is being handled inside the syntax highlighter control that is really a "3rd party" control. The source is part of the project, but I haven't delved into it that much. Most likely any problem like you're describing is in how the syntax file is set up.
Robin wrote:Does C# have regular expressions? If so, the check should probably be "(nonalphanumeric)if(nonalphanumeric)" (with (nonalphanumeric) replaced with the right escape code.)
If not, how about looking for " if " (but \n and \t have to be replaced by " " in a temporary string).
What if "if" is the first text in a line? Does (nonalphanumeric) handle line-breaks as well? What if it is the first/last text in a document? Won't you have to add the contingency:
"(nonalphanumeric|beginningoftext)if(nonalphanumeric|endoftext)"
I've used regex a lot, but there are certain quirks that I am still unsure of, especially when it comes to the different syntaxi.
Well, I'm used to Python regex, and there newlines can be matched just like any other character.
The search string one would use would probably be something like r"[\A\W]if[\Z\W]", or r"[\A\W]if[\W]" if it's not necessary to match an "if" at the end of the file.
Nonalphanumeric is every character that is.. not alphanumeric, so yes, it will match newlines. EOF might be a problem, you'd say * is enough (0 or more), but that also matches ifa (for example).
Well, yes, but the problem is you need to match (>0, nonalphanumeric)if(>0, nonalphanumeric), which doesn't match EOF. (I know that's not a regex, don't yell at me)
For the other: please disregard above discussion. It's nonsense. We don't know anything about regexes in C#. Look over there! Ponies! *runs off while everybody looks the other way*
Robin wrote:For the other: please disregard above discussion. It's nonsense. We don't know anything about regexes in C#. Look over there! Ponies! *runs off while everybody looks the other way*
What about them? Why are you saying such mean things?
But anyway, to return to the topic at hand: we have no clue about regexes in C#. At least I don't. Please, somebody who knows what the heck they are talking about: say something! (Or, you know... post a reply...)