Quote:

I can see com being used to make things for non-scripters (at least for those who want access to data from, or some other method of controlling/using, other apps from mIRC). However, I can't see how $regsub specifically benefits a non-scripter. Obviously, it makes doing regex much easier, but I'm sure anything $regsub can do could also be done in some other way. It might not be as clean or as fast, but I'm sure it would be possible. As such, I just can't see that really benefiting the non-scripter who doesn't know if a script uses $regsub or some other method. At least, not unless it saves noticeable time for a script to run.


A couple of weeks ago, someone came to me on IRC, they had trouble parsing a website. The problem was the entire site was on 3 lines or so, and he couldn't parse it using variables obviously. Parsing with binvars on the spot doesnt help either, because the received data is chunked in parts. Parsing with binvars _could_ work if the entire site is first written to a file, and then read into a binvar, and parsed with $bfind. $bfind however only accepts wildcards, not a powerful tool as regex, and it involves a lot more coding, and isn't nearly as flexibly as $regsub is.

This person knows regex, but still came to me. I ended up giving him a code that uses COM to communicate with the DOM (document object model) to let IE do the parsing, so we can simply iterate through a collection.

If he could pass the string to a $regsub, he wouldn't have had to contact me, and I wouldn't have had to think for an hour how to solve this in a reasonable way.

Have you ever wanted to modify a file that contains thousands of lines of data? Maybe something similar to what that Bob57 guy had in his File I/O thread. There is no way using conventional methods, as they are all too slow. The code I wrote for him was atleast 30 lines, though If i could have passed a binvar to a regsub, it would have been 4 lines at most (I'm being generous here)

Do you remember I gave you the advice in that thread to use the file handling commands or filter instead of $read as that would be way too slow. Going by your logic of "Obviously, it makes doing regex much easier, but I'm sure anything $regsub can do could also be done in some other way. It might not be as clean or as fast, but I'm sure it would be possible.", then we should have never introduced the file handling commands, because we already have /write, $read /bwrite and /bread, right?

The "if we can do it in one way, why would we ever need an other" mentality. If $regex has no purpose whatsoever, then why does it exist in the first place? If it has a purpose for scripters, then it has a purpose for the people the scripters script for.

Take a look at this post. I look forward to seeing your scripted version not using regex/regsub, providing the same functionality. Good luck smile

Anyway, we both got our point accross and I'm ok with that, agreeing to disagree is fine for me.


Gone.