Make a tutorial!

@Stevon8ter Whoa, now we are getting really pushy!

Better get that tutorial finished fast, Stevon8er is getting cranky!

Hahaha :wink:

Well I don’t need it anyways :wink: well not soon… I already got my patterns set up thanks to @SkyTheCoder’s post-tutorial on my textbox thing :wink:

But I wanna learn them one day, just not now :wink:

Here is my try: It probably has a lot of improvement room.

Lua Patterns

Hello! Many of you probably think Lua patterns are like rocket since, but in Lua. This is quite the opposite.
The only confusing part is rememberimg all the characters and string functions.

We will start off with a basic example. The string.find() function. You give it somthing to look for in a
string, like “car” in racecar, and it will return the starting and ending position of the car like so:

string.find("racecar", "car")
Starting at five, ending at 8.

But what if you don’t really know what to look for in “racecar?” Then you will need the character “.” which basically
fills in any symbol or letter in its position. Lets test it out:

string.find("racecar", 'c..')
Starting at five, ending at 8.

Here is another useful objects to learn:

“%u” == Matches a letter in uppercase

“%d” == Matches a number

“%D” == Matches all letters, but not digits.

But even with those we are still held back. What if we don’t know what we are looking for?
Thats where the more advanced ones come in:

“+” == Matches the last character as many times as possible.

“*” == Matches the last character as many times as possible.

“?” – Makes the last character optional

“-” == Matches the last character as few times as possible.

One other thing you should know about these. They do not count as a string. You have to
put them inside of ‘’ instead. So it will be like:

string.find("PeopleOnCodeaWantHomeworkDone", '.*')
Starting at 1 ending at 27. There are other other string functions to like:

string.sub() – Gets rid of parts in a string by giving it a starting and ending point.
string.gsub() – Gets rid of a certian pattern.
string.match() – Returns a certain pattern.

While there are more, these are the most important.


You almost got it… I went to sleep and came back to this. I’ll make a tutorial…

Update: Opening Pages on my Mac…

Update: Lot of stuff to cover…

Update: Getting there…

Update: I keep on realizing more things to add…

It’s ok, we’re just teasing you, no rush…take your time and make it good

@Ignatz I know. :stuck_out_tongue: Almost done, I have to go now though, but when I come back I’ll add some extra helpful links and proofread it.

Currently tallies up to 1,764 words and 5 pages.

Don’t leave! Come on we need this so much! I told you no programmer could get his head around it, you’re mean :frowning: