webDOMinator - Minion Scripting Language Reference

Search a Command:
<< Back to Regular Expression Commands

regex

Usage...
regex:handle=pattern
Creates a new regular expression matcher object which matches information on the page using pattern. There are some set regular expression handles which already exist in the libfolder, like regex.email, so these do not need to be declared, they can just be used.
This applies to webDOM version 2.5.3 and above.

User Comments on regex

Example of grabbing emails

Written by: webDOMinator 1 year and 8 months ago

This is a couple examples of using the new regex libraries and functionalities:

Code

//Gather emails to the list
regexgather:regex.emails

Code

//Access different emails from the page
echo:regex.email.1
//the second email match
echo:regex.email.2
//these can be put into other variables.
var:message=is your email ^regex.email.1^?

Code

//creating a regular expression that's not from the library
regex:userid=_([0-9]{5,6,7})_
var:firstuserid=regex.userid.1
//if you want to save this to the library for later use
saveregex:userid

The regular expression system allows you to easily access sub-matches of matches as well.
Code

regex:address=^([0-9]+)\b(\w)(ave|st|street|place|plc)([a-zA-Z ]),([a-zA-Z ]) ([0-9](5})$
var:streetnum=regex.address.1.1
var:street=regex.address.1.2
var:streettype=regex.address.1.3
var:city=regex.address.1.4
var:state=regex.address.1.5
var:zip=regex.address.1.6
echo:var.streetnum^ ^var.street^ ^var.streettype

Post a Comment About the "regex" Command
Title:
Comment:
Post as Anonymous:
User Login
Username:
Email:
Password:
webDOMinator is copyright ©2008, 2009, 2010, 2011, 2012 Nathaniel D. Gibson. All Rights Reserved.
Contact | Tutorials | Forum
By using webDOMinator you are taking all liability in to your own hands. Nathaniel D. Gibson is not responsible for any damages, loss, or defamation (legal or otherwise) caused to you or your business from using this program. Nathaniel D. Gibson is not associated with, affiliated with, nor responsible for the content submitted and displayed by users of this site.