ID:264830
 
I'm trying to get regular expressions to work in DM. So far I've found two libraries that allow the use of regular expressions:
hub://LummoxJR.Regex is a hub entry advertising a regular expressions library. By the looks of things the file has been removed and the hub entry is stale.
hub://Kuraudo.libregex is the library I'm trying to use now. It uses a DLL file which also speeds things up a lot.

Unfortunately, Kuraudo's library keeps crashing on me when I try to put in anything remotely complex:

var/len = regex_search_first(string, "(\\s+?)(\\()(.*)({)\[\\r|\\n]")
if(!len)
world << "Invalid parameters!"
return 0


I guess my question is to the regular expression fans out there: is my query accurate? I've constructed it using the "RegExr" tool (http://gskinner.com/RegExr/) but every time that bit gets executed DreamSeeker crashes thanks to the DLL.

I'm not that experienced with C++ and the expression is complex enough to make me second guess myself. Am I doing this right?
You have a lot of capture groups () there. Is that intentional?
In response to Stephen001
Stephen001 wrote:
You have a lot of capture groups () there. Is that intentional?

It SEEMS to validate properly (but causes a crash in the library).

My intention was to filter out part of a function call. Like:
myfunction(param1, param2, param3){
In response to Android Data
Depending on how complicated you want to get, that may not be possible with a regex.

If the function call can have arbitrary parameters - for example, other function calls - it's impossible because regular expressions cannot match arbitrarily nested constructs.

The style of regex Kurado is using may be different to the style you're using - there are different 'syntaxes'. I'd check to make sure.