[pcre-dev] [Bug 1203] New: desired features: match-and-subst…

Startseite
Nachricht löschen
Autor: Steve Andrews
Datum:  
To: pcre-dev
Betreff: [pcre-dev] [Bug 1203] New: desired features: match-and-substitute and permutations
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1203
           Summary: desired features: match-and-substitute and permutations
           Product: PCRE
           Version: N/A
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: wishlist
          Priority: medium
         Component: Code
        AssignedTo: ph10@???
        ReportedBy: steven.s.andrews@???
                CC: pcre-dev@???



Hi,

I'm hoping to add the C PCRE library to software that I've written (Smoldyn,
which is used for biochemical simulations) so that users can use regular
expressions in their model definition files. This won't just simplify things
for my users, but will also enable a versatile and powerful "rule-based
modeling" method. To do this, I need two PCRE features that I don't think
exist currently. If they do exist, then my apologies for not having found
them, but I'd be grateful for assistance in finding them.

(1) I need a library function that can perform pattern matching substitutions.
It would be declared sort of like this:

int matchandsub(pattern1,string1,pattern2,string2);

For example, suppose I gave this function pattern1="a.c", string1="abc", and
pattern2="j.k"; string2 is only for output. I want the function to see that
yes, string1 is a correct match for pattern1 and that the letter b is the
substituted letter. Then, it puts 'b' into pattern2, returning it in string2
as "jbk". In general, pattern1 and pattern2 would have to have the same
expression forms (or, more precisely, pattern2 would need to have a subset of
the expressions used in pattern1).

(2) I need regular expression support for pattern permutation. For example,
it's standard that the pattern "abc|def" matches to either "abc" or "def".
However, I want to write the pattern "abc&def" and to have this match to either
"abcdef" or to "defabc". This would be a significant new addition to regular
expression matching, but I think would be highly compatible with the current
design philosophy. It would also make PCRE more useful for bioinformatics and
other applications.

Thank you!
-Steve


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email