Regex wildcard in XML Query

Björnke von Gierke bvg at mac.com
Wed Oct 15 09:36:01 EDT 2014


I'll just leave this here: http://stackoverflow.com/a/1732454/2149933

On 09 Oct 2014, at 18:41, Peter Haworth <pete at lcsql.com> wrote:

> 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>



-- 

Use an alternative Dictionary viewer:
http://bjoernke.com/bvgdocu/

Chat with other RunRev developers:
http://bjoernke.com/chatrev/






More information about the use-livecode mailing list