Re: [xsl] Regular Expressions in XPath 2.0

Subject: Re: [xsl] Regular Expressions in XPath 2.0
From: "Rashmi Rubdi" <rashmi.sub@xxxxxxxxx>
Date: Sun, 22 Apr 2007 00:44:58 -0400
I read all replies and  would like to thank everyone for further
guidance and replies.

Almost every Regexp package in every language, find it's root in Perl's regexp.
Similar but not identical. Pretty well a subset of what's in Perl.

Definitely helps to know the above.


They are similar and certainly not identical
An important information, is that they are an extension of XML Schema's Regexp.


I think this is XML Schema's Regexp: http://www.w3.org/TR/xmlschema-2/#regexs


I would say that learning them for XPath, is a good start because you
can test them easily in XSLT examples.


Thanks, infact one of the first examples in the XSLT 2.0 Reference book is an excellent implementation of tabulating work frequencies. I tried this example, and I'm going to try more examples as well.

This is a good place to start...
http://www.roblocher.com/technotes/regexp.aspx


Thanks for the above link, it's nice to have a tabular reference of patterns as shown with the link, I tried the pattern \W+ , to match one or more non-word characters, it matched the first non-word. Nevertheless, it's a useful reference.

Don't know if this is close or very different from the XPath 2.0
regexs, but this seems like an extensive tutorial:
   http://www.regular-expressions.info/tutorial.html

Thanks for the link, I also have a book on RegEx, but in school we were taught regular expressions with diagrams -- I think those were Finite Automata diagrams -- unfortunately none of the books or websites (tutorials) on Regular Expressions use those diagrams to represent regular expression patterns.

Regular expression pattern diagrams really helped in understanding or
in representing regular expressions.

I'll research on text books/sites etc that explain Regular Expressions
in automata diagrams.

There's no standard.

Thanks , it helps to know.


but in recent years many languages have imitated Perl
to some extent, despite the fact that Perl regular expressions are very
poorly specified (try for example to find the rules on when \n is a
back-reference and when it is an octal character escape).



although perl is just a youngster really and picked up much of that from
teh usual unix tools such as sed and awk, regular expressions themselves
are of course rather older than digital computers, so much older than
perl.


Agreed, I've also been learning some parts of Unix/Linux and tried Awk.


-Regards
Rashmi

Current Thread