about getting newstr

two questions with regex:

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?

@firewolf, from what I can tell, you should look at the string library in the reference

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.


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