Hello I have a huge text which also includes email addresses.
How can I select only the emails from it?
I thought of searching all “@” signs and than selecting the whole word but I don’t know how to select the whole word command.
Thanks,
Alex
Hello I have a huge text which also includes email addresses.
How can I select only the emails from it?
I thought of searching all “@” signs and than selecting the whole word but I don’t know how to select the whole word command.
Thanks,
Alex
To select a word, ctrl/cmd + D should do it.
To select an email, I would go with some regex Find All. This regex works well:
(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])
Wow! That regexp is awesome! Thanks alot iamntz!
Where can I learn to write regexp expressions?
Have a good day,
Alex
I can’t tell you where you can learn that kind of regex, since I had to copy from another place
But I can suggest you where can you learn more:
Various online tools. The main advantage on RegexBuddy is that it can use more engines, while the online ones, obviously, are able only to run JS regex
Those are some great resources for Regex, thanks!
– np
edit …
When you talk about engines. What regex engine is ST3 using for its regex?
I’m not sure if the search regex is the same though, maybe @wbond will clarify this a bit:
Which is to say that it uses a flavor of regex that contains many of the features from PCRE regexes.
The syntax highlighting uses our custom engine, but will fall back to Oniguruma when it can’t handle a construct.