For all current cases, enhanced re_extract will return string value. The behaviour depends on parameter, which is almost always constant and never supposed to be negative. I agree in that it looks like a hack, but I was aiming to avoid code duplication.
Number of expected submatches is not so important, because it is encoded in the regexp. The whole regexp must match, anyway.
Also, it was only a concept, and it needs more work. I've made some bugfixes already.
-- Pavel Levshin 25.10.2013 13:48, Boylan, James:
While I like the addition of this feature, I have concerns as it breaks the convention of re_extract where it is expected to return a string. It might be better to change this into a new function (re_extract_hash, maybe?) and then have it always return that indexed container? At that point you could always have it return that format and be able to adjust the number of expected matches that return in that format as well since you don't have to leave the existing format in place.
_______________________________________________ rsyslog mailing list http://lists.adiscon.net/mailman/listinfo/rsyslog http://www.rsyslog.com/professional-services/ What's up with rsyslog? Follow https://twitter.com/rgerhards NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE THAT.

