Picture says it all ... xD
[attachment=1098:wtf.PNG]
What's going on there? How is it finding '/ *' ? ( two spaces )
string.find fail?
Started by remiX, Mar 26 2013 10:21 AM
3 replies to this topic
#1
Posted 26 March 2013 - 10:21 AM
#2
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('\ +')
#3
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?
What I wanted it to do is look for '/ *' in a string, how can you do that then?
#4
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 *.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











