Re: find and replace, and other questions
[email protected] Mon, 13 Dec 2010 09:26:47 -0500
| Newsgroups | gmane.mail.spam.crm114 |
|---|---|
| Message-ID | <[email protected]> |
Ahhh, it's been a long time, eh? First off, the "\-constants" mentioned in the manual aren't the same as the back reference \1, \2, etc. The \-constants are things like \n (newline), \t (tab) and \xHH (hex char) and \oOOO (octal char) are constants in the "C" language sense. They exist solely so that it's easy to put in a single byte wide character of whatever value desired easily. But- the \1, \2, etc. values are REGEX-engine back-references. They aren't constants; the regex engine is constantly rebinding them as it tries to do the first-longest REGEX match. Thus, they are in a state of flux until the regex completes. Further, the regex engine doesn't explictly export them back; rather the parenthesized variables _are_ exported back, explicitly, and Ville Laurikari (the author of TRE) is very careful not to break that part of the interface.. Note also that \1, \2 etc. are _usually_ but not _always_ mapped to the "bound variables" you get out of a match statement. That's because in TRE (and thus in CRM114) it's possible to set a "no bind" on a parenthesized subexpression (I'm trying to find that; I recall seeing it but can't find it now). So- the bottom line is that it might be possible to do your \1 modifier, but it would be fraught with peril, and not stable with respect to Ville's work. Thus, I'd say "find a different problem to work on". :( re: the library: And yes, our major effort this year has been to create / improve the C-callable library. For a lot of users (especially the user who's paying for this work to be done!), the ability to integrate tightly (and the speedup when you change from the CRM114 JIT language compiler to a C-callable subroutine call) is really important. The library is LGPLed, and on the download page of the web site. Right now I'm making an improved tenfold-validate program to test yet another new classifier- a boosted RULAX (Are You Like An X) classifier. The idea is to use boosting (an array of very simple but weak classifiers) to build a strong classifier by voting. - Bill Yerazunis ------------------------------------------------------------------------------ Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL, new data types, scalar functions, improved concurrency, built-in packages, OCI, SQL*Plus, data movement tools, best practices and more. http://p.sf.net/sfu/oracle-sfdev2dev