generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Regex is amazing, why does Lua no regex?

Previous Thread :: Next Thread 
mustyoshi is not online. mustyoshi
Top 50 Poster
Joined: 27 Dec 2007
Total Posts: 41651
20 Dec 2011 01:00 PM
((\d+)[d](\d+))([-,+]?\d+)?
That regex is best regex.

~Monica
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
20 Dec 2011 01:01 PM
[ Content Deleted ]
Report Abuse
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
20 Dec 2011 01:02 PM
@Octoxide

Regular expression i think.





But idk wat that is.



I think some string function can use them as a string to find stoof from a string.
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
20 Dec 2011 01:03 PM
[ Content Deleted ]
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
20 Dec 2011 01:03 PM
Regedit = Registry editor, so Regex = Registry excluder

:D
Report Abuse
GigsD4X is not online. GigsD4X
Joined: 06 Jun 2008
Total Posts: 3794
20 Dec 2011 01:15 PM
EVERYBODY CALM DOWN! I KNOW REGEX.
Report Abuse
mustyoshi is not online. mustyoshi
Top 50 Poster
Joined: 27 Dec 2007
Total Posts: 41651
20 Dec 2011 01:34 PM
What does my regex do then?

~Monica
Report Abuse
ArceusInator is not online. ArceusInator
Joined: 10 Oct 2009
Total Posts: 30553
20 Dec 2011 01:36 PM
That's the most hideous thing I've ever seen. I looks like you ate random characters, vomited them into a woodchipper, then microwaved the result.
Report Abuse
mustyoshi is not online. mustyoshi
Top 50 Poster
Joined: 27 Dec 2007
Total Posts: 41651
20 Dec 2011 01:39 PM
@Arceus
My jimmies were rustled by your post.

~Monica
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
20 Dec 2011 01:51 PM
@Arceus
Lrn2program


@OP
Yeah I'd love the feature in most languages where you can do a find/replace-like operation, like PHP does:
'#\[color=\#?([A-F0-9]{3}|[A-F0-9]{6})\](.*?)\[/color\]#is'
To
'>span style="color: #$1;">$2>/span>',

Just some example I grabbed to show people who don't understand what I'm getting at by "find/replace-like operation" :)
Report Abuse
NXTBoy is not online. NXTBoy
Joined: 25 Aug 2008
Total Posts: 4533
20 Dec 2011 01:56 PM
> What does `((\d+)[d](\d+))([-,+]?\d+)?` do then?

Matches text such as:

 * 123d45+345
 * 98765d43
 * 9d0,01
 * 1d33-7

I don't understand the point in this regex. Those are very strange things to match
Report Abuse
mustyoshi is not online. mustyoshi
Top 50 Poster
Joined: 27 Dec 2007
Total Posts: 41651
20 Dec 2011 02:51 PM
@NXT
How about when you consider a simpler thing it matches?
1d20
4d6+3

(DM says you're gonna die, roll a dee six)

And herp derp, I didn't know that it matches commas, I thought commas were used to seperate different matches o_o

~Monica
Report Abuse
NXTBoy is not online. NXTBoy
Joined: 25 Aug 2008
Total Posts: 4533
20 Dec 2011 03:32 PM
@mustyoshi: I figured the comma was probably a mistake.

I've never really player a game where the dice are named like that.

The regex you really want is:

    (\d+)d(\d+)([-+]\d+)?
Report Abuse
mustyoshi is not online. mustyoshi
Top 50 Poster
Joined: 27 Dec 2007
Total Posts: 41651
20 Dec 2011 03:44 PM
@NXTBoy
Darn you for making my matching moar efficient. :(

~Monica
Report Abuse
Varp is not online. Varp
Joined: 18 Nov 2009
Total Posts: 5333
20 Dec 2011 04:37 PM
Lua's patterns can basically do anything you can do with regex (it even supports back references)...
Report Abuse
HotThoth is not online. HotThoth
Forum Moderator
Joined: 24 Aug 2010
Total Posts: 1176
20 Dec 2011 06:40 PM
Both of them cover the same family of languages, namely Regular Languages (hence the name "regex" from "regular expression"). In FSA (finite state automata) theory, this is one of the most basic and limited classifications of languages. While still really powerful, you can't tell things like "matching number of left and right parentheses". For those of you interested in the theory behind computer science, FSA theory has some really cool proofs for things like "What kinds of questions will computers never be able to answer?" or "What kinds of questions can a computer or other machine answer with only a finite number of 'states' and without any memory?" [hint: see topic].
Report Abuse
TheCapacitor is not online. TheCapacitor
Joined: 19 Jan 2011
Total Posts: 7045
20 Dec 2011 07:05 PM
Ahem, string.gsub.
Report Abuse
mustyoshi is not online. mustyoshi
Top 50 Poster
Joined: 27 Dec 2007
Total Posts: 41651
20 Dec 2011 07:32 PM
Jared, I'm your biggest fan!

~Monica
Report Abuse
NXTBoy is not online. NXTBoy
Joined: 25 Aug 2008
Total Posts: 4533
21 Dec 2011 03:47 AM
> While still really powerful, you can't tell things like "matching number of left and right parentheses"

Actually, in lua you can - there's a "matching bracket" specifier in Lua Patterns.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image