Not urgent, for whenever you might feel like looking at this, Alan:

The MARK feature which we previously discussed is implemented in the new PCRE 
8.10 release. To use it I think the regex plugin would need some enhancements.

In the last related message you asked if it would apply only to pcreMatch. 
Since it is part of the pattern, seems to me it could also apply to the others, 
in which case all that would be available would relate to the last match 
processed. For pcreReplaceCallback, might be useful in the callback routine.

Possibly a new plugin option should trigger the EXTRA block, flag, etc., 
similar to the trigger that was added to pcretest to avoid unnecessary 
overhead. And you suggested a new plugin variable regex_mark for storing any 
returned string.

There was also a new PCRE_UCP compile time option added in 8.10. Even without 
adding it to the plugin, we can already use it via an internal pattern option.

Regards,
Sheri

--- In power-pro@yahoogroups.com, "entropyreduction" 
<alancampbelllists+ya...@...> wrote:
>
> 
> 
> --- In power-pro@yahoogroups.com, "Sheri" <sherip99@> wrote:
> >
> > For example, the pattern
> > 
> > X(*MARK:A)Y|X(*MARK:B)Z
> > 
> > after matching against XY, the markstring would be "A".
>  
> > Other verbs could also set the string. E.g., (*PRUNE:A) would be equivalent 
> > to (*MARK:A)(*PRUNE). (*THEN:A) would be the same as (*MARK:A)(*THEN).
> 
> Can't say I follow that bit, but never mind.  
> 
> Is it possible to need or get more than one markstring per match?  I would 
> guess not, from what you quote re api and pcre test, but I don't understand 
> why not.
> 
> Never mind.  Assuming only one markstring can happen as a result of call to 
> plugin pcreMatch, could plonk it in a new standard variable, e.g. regex_mark.
> 
> I assume markstrings would be ignored in pcreMatchall, pcrerReplace
>  
> > I guess the point is, after the match, it could be possible to do some 
> > conditional processing dependent on the content of the markstring. I 
> > suppose some new regex plugin option might be needed to communicate that 
> > when you want a markstring. ?  Appears the pcretest.exe app in the test 
> > version has an option to retrieve the markstring.
> > 
> > From the draft pcreapi doc:
> > 
> > If PCRE_EXTRA_MARK is set in the flags field, the mark field must be set to 
> > point to a char * variable. If the pattern contains any backtracking 
> > control verbs such as (*MARK:NAME), and the execution ends up with a name 
> > to pass back, a pointer to the name string (zero terminated) is placed in 
> > the variable pointed to by the mark field. The names are within the 
> > compiled pattern; if you wish to retain such a name you must copy it before 
> > freeing the memory of a compiled pattern. If there is no name to pass back, 
> > the variable pointed to by the mark field set to NULL. For details of the 
> > backtracking control verbs, see the section entitled "Backtracking control" 
> > in the pcrepattern documentation. 
> > 
> > Regards,
> > Sheri
> >
>


Reply via email to