How to find a word within text using XSLT 2.0 and REGEX (which doesn't have \b word boundary)?

Posted by Mads Hansen on Stack Overflow See other posts from Stack Overflow or by Mads Hansen
Published on 2010-03-07T19:22:26Z Indexed on 2010/03/08 7:36 UTC
Read the original article Hit count: 434

Filed under:
|
|
|

I am attempting to scan a string of words and look for the presence of a particular word(case insensitive) in an XSLT 2.0 stylesheet using REGEX.

I have a list of words that I wish to iterate over and determine whether or not they exist within a given string.

I want to match on a word anywhere within the given text, but I do not want to match within a word (i.e. A search for foo should not match on "food" and a search for bar should not match on "rebar").

XSLT 2.0 REGEX does not have a word boundary(\b), so I need to replicate it as best I can.

© Stack Overflow or respective owner

Related posts about xslt-2.0

Related posts about regex