[OS X TeX] ifthen and regular expressions

Friedrich Vosberg fvosberg at mac.com
Wed May 23 15:59:06 EDT 2007

Am 15.05.2007 um 17.11 schrieb Jeffrey J Weimer:
>
> On May 15, 2007, at 7:13 AM, Friedrich Vosberg wrote:
>
>> Does someone of You know how to get an ifthenelse switch that is
>> TRUE if the expansion of the given macro contains a given string.
>> For example:
>>
>> \def\string{court}
>> \def\pattern{Royal High Court of Westminster}
>>
>> \ifthenelse{contains{\string}{\pattern}{%
>>   TRUE
>> }{%
>>   FALSE
>> }
>
> The coolstr package may be able to handle this.

It seems You are all right, but I don not find the matching values.

===== 8>< =====
\documentclass{ltxdoc}
\usepackage{coolstr}
\begin{document}
\ifstrchareq{The Royal Court of Westminster}{0}{Court}{%
TRUE
}{%
FALSE
}
\end{document}
===== ><8 =====

I do not understand which value is needed in \ifstrchareq for the
second argument.

Any hints?

TIA and kind regards, Friedrich

--
»We have to expect it, otherwise we would be surprised.«