Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

regular expressions in scripting, please

Shebang Sunshine
Royal PITA
Join date: 3 Dec 2002
Posts: 765
03-02-2003 12:55
Please.

Pretty Please.

Pretty Please With Sugar On Top.

SubStringIndex and StringLength work, but a regex would be soooo sweet =)
_____________________
--
Gravy: the new ice cream.
Ama Omega
Lost Wanderer
Join date: 11 Dec 2002
Posts: 1,770
03-02-2003 13:00
I must admiit I was never a master of regular expressions, but I did love my tricks for Vi.

Adding some regular expression like system would be really nice for parsing chat channels for commands and communication between objects.
Sleeper Guillaume
Explorer Achiever
Join date: 8 Jan 2003
Posts: 120
03-02-2003 15:21
I just figured they would be added in due course.... obviously we need this. Just adding my voice.
Wednesday Grimm
Ex Libris
Join date: 9 Jan 2003
Posts: 934
s/no/yes/
03-03-2003 06:59
While I agree that this would be useful, a full regex engine would be a HUGE load on the simulator (I imagine), and the functionality that most people would use, most of the time is available through the existing string functions. (What I mean is that it is already possible to do all the things you need to do, regexes would just be another way to do it).

So, if I get a vote, it goes to either not adding regexes, or adding a very limited regex engine, maybe just with ! * and . matching.
Shebang Sunshine
Royal PITA
Join date: 3 Dec 2002
Posts: 765
03-03-2003 09:21
From: someone
So, if I get a vote, it goes to either not adding regexes, or adding a very limited regex engine, maybe just with ! * and . matching.


Everybody gets a vote =)

I can live with very limited. The SubStringIndex/StringLength dealie works beautifully, btw =)

It would just be so much easier using a regex.
_____________________
--
Gravy: the new ice cream.
Apotheus Silverman
I write code.
Join date: 17 Nov 2003
Posts: 416
07-17-2004 11:40
I highly support this idea. Regexp functionality would be a very nice addition.
_____________________
Apotheus Silverman
Shop SL on the web - SLExchange.com

Visit Abbotts Aerodrome for gobs of flying fun.
Carnildo Greenacre
Flight Engineer
Join date: 15 Nov 2003
Posts: 1,044
07-17-2004 23:10
I say support full Perl-compatible regular expressions. The PCRE library is free, and should be fairly simple to add to the LSL VM.

(For an example of what regular expressions can be abused to do, check out my signature. It's a program to print all prime numbers, which does the math in base 1, courtesy of the power of regular expressions.)
_____________________
perl -le '$_ = 1; (1 x $_) !~ /^(11+)\1+$/ && print while $_++;'