leuce Posted January 3, 2020 Share Posted January 3, 2020 Hello everyone Does anyone know what is the regular expression (in AutoIt syntax) for extracting e-mail addresses? Thanks Samuel Link to comment Share on other sites More sharing options...
seadoggie01 Posted January 3, 2020 Share Posted January 3, 2020 I'm not sure of the exact rules, but I think each email address must: Not contain spaces Contain an @ Contain a period with an ending (ie: .com, .org, .edu, etc) So you could use something simple like this: ([^\s]*@[^\s]*\.[^\s]*) All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted January 3, 2020 Share Posted January 3, 2020 @leuce Wikipedia says quite enough about the syntax of an email address, so, other than providing some real-World example you are working with, why don't you show us what you tried? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
leuce Posted January 3, 2020 Author Share Posted January 3, 2020 (edited) 47 minutes ago, FrancescoDiMuro said: @leuce Why don't you show us what you tried? I could do that, of course, but how would I (or you) know of the regex is any good? Even if it manages to extract *some* e-mail addresses would not be proof that it is the proper regex for extracting *all* e-mail addresses. The whole point of using the correct regular expression is to avoid using an expression that works only in test cases. Are you saying that you'll tell me the correct answer only after I've given you some likely incorrect attempts? :-) Edited January 3, 2020 by leuce Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted January 3, 2020 Share Posted January 3, 2020 @leuce You can find yourself a tons of pattern on the Internet which cover in details what you are looking for. Why ask here then? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
mikell Posted January 4, 2020 Share Posted January 4, 2020 When googling "email regex" the very first link returned is this one Please read the page and choose your flavour FrancescoDiMuro 1 Link to comment Share on other sites More sharing options...
jchd Posted January 4, 2020 Share Posted January 4, 2020 To kill this bird, here's the optimized regex J. Friedl published in his first edition of "Mastering Regular Expressions". Just like he said: Enjoy! FrancescoDiMuro 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now