[NTG-pdftex] \pdfmatch (was: Patch EscapeAndOther)

Heiko Oberdiek oberdiek at uni-freiburg.de
Thu Jun 30 17:06:13 CEST 2005


On Thu, Jun 30, 2005 at 12:06:32PM +0200, Martin Schröder wrote:

> On 2005-06-25 03:52:01 +0200, Heiko Oberdiek wrote:
> > \pdfmatch [icase] [subcount <number>}] {<pattern>}{<string>}

> > \pdflastmatch <number>

> While this is a VERY nice feature, I'm reluctant to include this

This is experimental yet. Currently I am experimenting with
"pcre" that is more powerful. Result so far:
* changed syntax for \pdflastmatch:
    \pdflastmatch <general text>
    Thus keywords can also be used, saving new primitives:
    * \pdflastmatch{<number>} same semantics as before
    * \pdflastmatch{match} = \pdflastmatch{0} (perl: $&)
    * \pdflastmatch{subject} => whole string
    * \pdflastmatch{prematch} => part before "match" (perl: $`)
    * \pdflastmatch{postmatch} => part after "match" (perl: $')
    * \pdflastmatch{last_paren_match} => last substring (perl: $+)
* Unclear: options, how they are specified:
  * \pdfmatch anchored caseless ... {}{}
    * any order?
    * alphabetical order for easier/faster scanner?
  * Or options in separate argument, similar keyval?
    \pdflastmatch{anchored,caseless,...}{<pattern>}{<subject>}
    or \pdflastmatch options{...} {<pattern>}{<subject>}
* Eventually replace feature.

> - I doubt that regex.h is portable; we should keep Windows in
>   mind.

regex: at least it is POSIX. Thus there is a chance that this is
implemented in Windows compileres.

pcre: they say it is possible to compile it under Windows.

Yours sincerely
  Heiko <oberdiek at uni-freiburg.de>
-- 


More information about the ntg-pdftex mailing list