Regular Expressions You Would Use in GAT

GAT has some very powerful filtering right at your fingertips, but you can boost this by an order of magnitude by adding regular expressions to the metadata search criteria.

As one of our customers wisely said if you have a problem that involves having to use a regular expression, then you have two problems….

But good news, we hope to make it a little simpler for you, so here are some regular expressions you might find useful for day to day searching in GAT.

Note in Examples: Domain name = bsn.ie,

ALSO be sure to remember to tick the box ‘Reg Ex’ in the search area

All addresses from your domain

[a-zA-Z0-9-]+@(bsn\.ie)

All addresses not from your domain

[a-zA-Z0-9-]+@(?!bsn\.ie).+

All addresses not from your domain or from bsn-corp.ie or bsninc.ie, etc.

[a-zA-Z0-9-]+@(?!bsn\w*\.ie).+

Any numbered account on your domain (deleted accounts pick up numbers for a period, these numbers are between 10 and 20 digits, but are typically 11).

[0-9]{10,20}

Any numbered account (with between 10 and 20 digits) from any domain

[0-9]{10,20}[@][a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{0,8})

or

[0-9]{10,20}+@[\S]+

should also work but has a looser domain definition.

Any email address that begins with Te or te at any domain.

^[Tt][e][\S]+@[\S]+

Will catch Test@bsn.ie or test@nsb.ie but not true@bsn.ie

Any email address that begins with Rob or rob at the domain bsn.ie

^[Rr][o][b][\S]+@(bsn\.ie)

Any email address that contains Ti or ti at the domain bsn.ie

^[\S]+[Tt][i][\S]+@(bsn\.ie)

Will catch Nastia@bsn.ie but not Arthur@bsn.ie

Any variable containing a string of the type X or x, followed by 00, followed by 6 or 7, followed by any 4 digits

(.*)[Xx]00[67]{1}[\d]{4}(.*)

Will catch ‘A man called bond X0071234 in a house.’

Any variable with no number in it will be caught by

^([^0-9]*)$

If student accounts all have numbers or are part numerical and staff accounts do not, this will return all staff accounts.

To search for null or blank fields use the regular expression

^$

This will return rows where there is no value in the column you are searching under.

To find two files at once with two different names

(Community|To)\b

Regular Expressions You Would Use in GAT

This is a great site for testing regular expressions.

Comments

comments