[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] xslt regex exclude string from variable used


Subject: Re: [xsl] xslt regex exclude string from variable used
From: Wolfgang Laun <wolfgang.laun@xxxxxxxxx>
Date: Thu, 13 Jun 2013 11:46:41 +0200

Oh, yes, silly me - that was nonsense.

But the "negative-look-ahead" triggered a completely wrong line of
thought - and I don't think you can avoid matching the given
expression E by any addition using negative look-ahead.

But you can modify the string represented by &journal_abbrevs; by
deleting the "example1" substring and one '|'.

-W

On 13/06/2013, Szabo, Patrick (LNG-VIE) <patrick.szabo@xxxxxxxxxxxxx> wrote:
> Thanks for your reply
>
> If I understand correclty you regex should match:
>
> any example1 followed by anything that is not not \s or a space or a number
> OR E
> So if the string is still in E it will still match right ?
>
> I've tried it anyway but it doesn't seem to have any effect.
>
>
>
> . . . . . . . . . . . . . . . . . . . . . . . . . .
> Developer Patrick Szabo
> Developer
> LexisNexis
> A-1030 Wien, Marxergasse 25
>
> mailto:Patrick.Szabo@xxxxxxxxxxxxx
> Tel.: +43 1 53452 1573
> Fax.: +43 1 534 52 146
>
> . . . . . . . . . . . . . . . . . . . . . . . . . .
>
> -----Urspr|ngliche Nachricht-----
> Von: Wolfgang Laun [mailto:wolfgang.laun@xxxxxxxxx]
> Gesendet: Donnerstag, 13. Juni 2013 11:26
> An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Betreff: Re: [xsl] xslt regex exclude string from variable used
>
> AFAIK, look ahead/behind is not in the XML Schema definition of regular
> expressions.
>
> In this particular regex, however, you might create the desired effect by
> preceding the expression E with this alternative:
>
>   (example1[^\s&#160;0-9]|E)
>
> -W
>
> On 13/06/2013, Szabo, Patrick (LNG-VIE) <patrick.szabo@xxxxxxxxxxxxx>
> wrote:
>> Hi,
>>
>> I'm using the following regex in analyze-string in xslt 2.0 and saxon 9.
>>
>>
(&journal_abbrevs;)[\s&#160;]*([0-9]{{4}})[,][\s&#160;][S]?[\.]?[\s&#160;]?([
0-9]{{1,4}})([\s&#160;][(][0-9]{{1,4}}[)])?
>>
>> &journal_abbrevs; looks like "example1| example2| example3|..."
>>
>> What I want to do now is exclude a certain string (e.g. example1) from
>> &journal_abbrevs for this specific regex.
>> I found the keyword negative look ahead but I can't get it to work.
>>
>> Any help would be much appreciated.
>>
>> cheers
>>
>>
>>
>> . . . . . . . . . . . . . . . . . . . . . . . . . .
>> Developer Patrick Szabo
>> Developer
>> LexisNexis
>> A-1030 Wien, Marxergasse 25
>>
>> mailto:Patrick.Szabo@xxxxxxxxxxxxx
>> Tel.: +43 1 53452 1573
>> Fax.: +43 1 534 52 146
>>
>> . . . . . . . . . . . . . . . . . . . . . . . . . .


Current Thread
Keywords