![]() |
Not here to argue how much WoW sucks.
|
Quote:
|
Quote:
|
Quote:
|
Quote:
Quote:
|
I ran into my situation with my setguild script where I needed some basic wildcard's for filtering error chat.
For example, "You must way %d seconds to use that command again!" would have bee useful. I ended up just matching the beginning and the end of the chat anyways, however. |
Quote:
|
Yeah's the kind of things I wanted to be able to do.
|
Hmmm It could be interesting to add support for pcre. You basicly just want one command with a string and a regular expression as parameters and you get back a string?
|
Quote:
|
I imagine people would want both a
string.match(pattern) -> boolean and a string.replace(pattern, replacement_string) -> string Where the replacement_string could include back-references (like $1 or $2) if pattern includes capturing parenthesis. I still think this is a bad idea though. |
Yeah, match and replace would be nice. And I still think that the fact that not everyone could use it is not a valid reason for not having it, that's just silly.
|
Quote:
|
Quote:
Replacing should optionally take a function instead of a string that is called with the matched part and groups and returns a replacement string. ^^ |
Quote:
|
Quote:
|
Three month bump.
I'm finding myself wanting this more and more :( Even Javascript has support built into the language (it's literally in the syntax) for Regular Expressions, come on now. |
Bump.
|
Do it.
|
Bumping because I'd really like this ^^
|
I would like this because it would allow people like Crow to make amazing things even more easily to entertain me.
Oh and people like Crow are amazing and deserve this kind of stuff. |
Quote:
Regular expressions are not the key to those super awesome things you'd like, but damn, they are useful. |
Quote:
|
specific example of when this would be necessary? I cannot think of any situation where a simpler solution wouldn't work.
|
Quote:
|
Quote:
The point is that they might be the better solution. Thats how scripting languages evolve and become better. If we didn't improve on what we already have, we would still have gs1. And in a lot of ways, regular expressions can be simpler than other solutions. It could be the difference of writing a pretty large chunk of code, and comparing a simple regular expression. |
I have never run into a problem where RegEx was needed on Graal and could personally care less whether or not it's added. I'm just asking the people in this thread who have "been in situations where RegEx would have useful" to support their arguments by stating what those situations were.
|
Quote:
|
Quote:
|
I've only needed this maybe... once or twice. I really wanted regular expressions those one or two times, but otherwise couldn't care less. It sounds awesome those few times you really want it, but other than that I can't see it being that useful.
|
Making a RegEx parser isn't difficult, but it be would be more effective to have it as an in-built one if it ever was added.
RegEx could easily be used for more advanced systems dealing with a lot of information that change over time, instead of searching by wildcards for example, regex would be more effective finding specific and advanced patterns. It would also be good for e.g. fixing typos, validate input, transform parts of strings into something else and more. "Changes should only be made because those changes will be useful." That's really productive, right... Who or what determines if changes are useful or not then? |
I believe Chompy just won this thread.
/thread |
Quote:
I'm guessing we agree and I just wasn't very clear in making my point. You wouldn't advocate adding feature X to GScript just because language Y has it, right? The post I was replying to said exactly that: Quote:
|
Quote:
|
| All times are GMT +2. The time now is 08:21 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.