2088 posts
Location
South Africa
Posted 26 March 2013 - 10:21 AM
Picture says it all … xD
[attachment=1098:wtf.PNG]
What's going on there? How is it finding '/ *' ? ( two spaces )
231 posts
Posted 26 March 2013 - 11:00 AM
The '*' symbol in a patterns means 0 or more of the previous character, so it finds a slash, a space, then 0 more spaces. If you want to only find strings that have at least two spaces, use '+', which means one or more.
l:find('\ +')
2088 posts
Location
South Africa
Posted 26 March 2013 - 11:27 AM
Oh i see, never knew * had an role in patterns.
What I wanted it to do is look for '/ *' in a string, how can you do that then?
1688 posts
Location
'MURICA
Posted 26 March 2013 - 11:29 AM
It'd be "/ ." if you want the * to stand for any character, or "/ %*" if you wanted a literal *.