RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details Pattern Title
Expression
^(?<path>(/?(?<step>\w+))+)(?<predicate>\[(?<comparison>\s*(?<lhs>@\w+)\s*(?<operator><=|>=|<>|=|<|>)\s*(?<rhs>('[^']*'|"[^"]*"))\s*(and|or)?)+\])*$
Description
Simple parser of XPath, it doesn't handle the more complex statements but can be of use in some situations.
Matches
/root/child1/child2[ @param='value' ] | child1[@param >= "1" and @foo < 'asdf"
Non-Matches
/root/*[ local-name() = 'child1' ][ child2/@param='value ]/child2
Author Rating: Not yet rated. Tim Walters
   Displaying page 1 of 1 pages; Items 1 to 1

Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials