two questions with regex:
1.
str = "HelloWorldabcCodea"
i wanna get:
newstr1 = "HelloWorldabc"
newstr2 = "Codea"
str = "qw/ertyui/o/pabcdefgh/ias/dfgh"
i wanna get after the 3rd ‘/’
newstr = "pabcdefgh/ias/dfgh"
two questions with regex:
1.
str = "HelloWorldabcCodea"
i wanna get:
newstr1 = "HelloWorldabc"
newstr2 = "Codea"
str = "qw/ertyui/o/pabcdefgh/ias/dfgh"
i wanna get after the 3rd ‘/’
newstr = "pabcdefgh/ias/dfgh"
and how many ‘/’ in str?
i wonder how to make it with one regex statement, i know how to make it with a few statements.
question 1. i must make use of “abc” as match
Since your question is about Lua itself, Googling something usually brings up an answer.
http://lua-users.org/wiki/PatternsTutorial
At the bottom of that page, it has something similar to what you want.
@firewolf there is no regexp in lua, but patterns instead. They are a bit tricky to master, but they do the job and are very quick. Check
http://codea.io/talk/discussion/5605/patterns-tutorial