PtokaX forum

Stuff => Offtopic => Topic started by: Jemte on 05 May, 2005, 09:05:05

Title: general regular expression question
Post by: Jemte on 05 May, 2005, 09:05:05
I have some text that I want to check for a certain pattern, but my problem is what if the text i want to check for is in the string numerous instances?

Is there a way to use regexps to capture each instance or would I have to parse the string iteratively?
Title:
Post by: bastya_elvtars on 05 May, 2005, 10:32:09
string.gsub(text,"(%S+)",function (word) dosomething() end)

The funtion is always executed when a non-space string is found in text.