Page 1 of 1

Qustion about Wildget?

Posted: Mon Feb 27, 2012 6:43 am
by Kasper
Dear,

I noted that the function "Wildget is" very common in the free scripts but cannot find any inforamtion on the pdf manual, kindly advise.

Regards,

Kenneth

Re: Qustion about Wildget?

Posted: Mon Feb 27, 2012 9:32 am
by Support
WildGet extract a match based on regular expression. The first parameter is the data you want to extract from, and the second parameter is the regular expression. If there is a match, it will return the match, otherwise it return nothing. If there are sub-match, they will be returned as a list, one per line.

x = '888-555-1212';
d = WildGet(x, '\d+');
The value of d is now...
888

d = WildGet(x, '(\d+)-(\d+)-(\d+)');
The value of d is now...
888
555
1212

Re: Question about Wildget?

Posted: Wed Feb 29, 2012 12:58 am
by Kasper
Thanks for your reply.

In addition to the (\d+) experssion, I found something like [^0-9], [^"] &[^0-9]*([0-9]{3})[^0-9]*([0-9]{3})[^0-9]*([0-9]{4}).... Kindly provide some source of reference such as websites for the RegEx usable in BrownReclues.

Regards

Re: Question about Wildget?

Posted: Wed Feb 29, 2012 1:11 am
by Kasper
It seems to me that each computer language e.g. Java, Perl, .net or Phyton has their own regular expression. I wish to know which type should be most similar to SBL. Thanks.

Re: Qustion about Wildget?

Posted: Wed Feb 29, 2012 1:17 am
by Support
I miised your previous post! BR uses Perl 5.0 compatible regular expressions. As long as you start your script with...

PerlRegEx = Yes;

Look at this link...
http://www.somacon.com/p127.php

and go down to Quick (Incomplete) Reference that's a good start.