|
| 23 Sep 2013 04:44 PM |
Is there a way to get string.gmatch to return every line of a multiline string? I'm not good with regular expressions, but this is what I came up with.
String = [[ Hello There :) ]]
for Capture,_ in String:gmatch(".+\n") do print(tick(),Capture) end
-- tickvalue Hello There :) --
It just prints the entire thing, not line by line. |
|
|
| Report Abuse |
|
|
|
| 23 Sep 2013 04:47 PM |
| I think you need to use a table. |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Sep 2013 05:27 PM |
"." is any character so \n fulfills this requirement.
String = [[ Hello There :) ]]
for Capture,_ in String:gmatch("[^\n]+") do print(tick(),Capture) end |
|
|
| Report Abuse |
|
|
| |
|
| |
|