Jump to content

Recommended Posts

Posted

Bard seems to think that it should work:

 

The regular expression teachersof[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z0-9.-]+\.[A-Z]{3}+\.[A-Z]{2} is a valid RE2 regular expression. It matches the following string format:

 

teachersof@....

For example, the following email addresses would match the regular expression:

 

[email protected]

[email protected]

[email protected]

However, the following email addresses would not match the regular expression:

 

[email protected]e

[email protected]@example.com

[email protected]

The regular expression starts with the string teachersof, followed by an email address. The email address must start with a username, followed by the @ symbol, followed by a domain name. The domain name must consist of a top-level domain (TLD) and a country code. The TLD can be any valid TLD, such as .com, .org, or .net. The country code can be any valid country code, such as .uk, .us, or .au.

 

You can use this regular expression in advanced content match in Gmail to match emails from teachers. You can also use it in other Gmail settings, such as routing rules and filters.

Posted (edited)

How about this:

(\W|^)teachersof[\w.\-]{1,25}@[\w.\-]{1,25}\.theplt\.org\.uk(\W|$)

 

Tried to modify the "Match Any Email Address from a Specific Domain" example here: https://support.google.com/a/answer/1371417

Found these guidelines too: https://support.google.com/a/answer/1346938

 

***EDIT***

Not sure why I thought you were doing this in Google Admin... It seems my brain just decided this was the case and went with it...

Edited by ThomL
Posted
so close but no cigar! teacherof doesn't get matched

 

Which one, mine?

 

Maybe this:

 

[color=#333333](\W|^)[teachersof][\w.\-]{1,25}@[\w.\-]{1,25}\.theplt\.org\.uk(\W|$)[/color]

Posted

Anyone got some good tutorials or websites to convert to Regex mostly email addresses but also IP addresses.

 

I've only used 1 or 2 times but trying to get my head around it :)

Posted

How about this:

 

TeachersOf\w{1,20}\d{1,3}-\w{1,3}@\w{1,20}\.theplt\.org\.uk

 

Assuming that the Student name is between 1 and 20 char, the number is between 1 and 3 char, and the letter after the - is between 1 and 3 char long. It also assumes that the bit before .theplt is made up of letters, and is between 1 and 20 char.

Posted (edited)

Does this work?

(\W|^)teachersof|TeachersOf[\w.\-]{1,25}@[\w.\-]{1,25}\.theplt\.org\.uk(\W|$)

 

I don't know enough regex... this matches on the tests I've done - I don't know how to make the teachersof|TeachersOf part case-insensitive.

Edited by ThomL

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...