Regex wildcard in XML Query
Peter Haworth
pete at lcsql.com
Thu Oct 9 12:41:24 EDT 2014
On Wed, Oct 8, 2014 at 9:12 PM, Glen Bojsza <gbojsza at gmail.com> wrote:
> <q
> xsi:type="xsd:pattern">IGD.NetDevice.\d{2}\.NetCommonInterfaceConfig.</q>
>
Hi Glen,
Couple of issues with using the above as a regex.
The period character means any character except newline in a regex. By
chance it works for the string you're looking for but it really should be
escaped with a backslash character.
The "\d{2}" looks for two digits and you only have one digit in that
position in the string. If you want to allow for 1 or 2 digits, you can
use either "\d{1,2}" or "\d\d?"
So your regex would be (untested):
<q
xsi:type="xsd:pattern">IGD\.NetDevice\.\d{1,2}\.NetCommonInterfaceConfig\.</q>
Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>
More information about the use-livecode
mailing list