This is a problem I'm having within my love2d game, however it's not specifically a love2d problem.
I need the the regex pattern that will allow me to extract the strings in-between the '|||' characters. I'm using string.gmatch().
tile_18.png,-195,-193|||tile_18.png,-194,-193|||tile_18.png,-193,-193|||tile_18.png,-192,-193|||tile_12.png,-195,-192|||tile_12.png,-194,-192|||tile_12.png,-193,-192|||tile_12.png,-192,-192|||tile_6.png,-190,-198|||tile_6.png,-186,-198|||tile_6.png,-184,-196|||tile_6.png,-189,-188|||tile_6.png,-190,-189|||
Regular Expression Help
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- GreenAvoro
- Prole
- Posts: 4
- Joined: Wed Apr 29, 2015 10:25 am
Regular Expression Help
Last edited by GreenAvoro on Mon May 14, 2018 3:14 am, edited 1 time in total.
-
- Party member
- Posts: 732
- Joined: Sat Apr 26, 2014 7:46 pm
Re: Regular Expression Help
This page documents how to split in lua.
http://lua-users.org/wiki/SplitJoin
http://lua-users.org/wiki/SplitJoin
Re: Regular Expression Help
The following should work as long as your file names do not contain "|"
Why is the input string such a mess in the first place?
Code: Select all
for s in string.gmatch(input, "([^%|]+)") do
print(s)
end
Who is online
Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Bing [Bot] and 3 guests