0

I need to update all the email addresses in my PHP/Codeigniter project placed in www folder. Can anybody tell me how should i get all type of emails by using Notepad++ or PhpStorm editors? I know this can be done by using regular expression, but i am unable to figure out exact regular expression for this purpose.

Devon Bessemer
  • 34,461
  • 9
  • 69
  • 95
Ali
  • 5,021
  • 4
  • 26
  • 45
  • 1
    possible duplicate of [Validate email address in JavaScript?](http://stackoverflow.com/questions/46155/validate-email-address-in-javascript) – Toto Nov 08 '13 at 08:17

1 Answers1

4

In PHPStorm, you can right click on a folder in the navigation window and click Replace in Path

Regex: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6} should match all email addresses.

Devon Bessemer
  • 34,461
  • 9
  • 69
  • 95
  • He is looking for a regex which will match all email addresses. – Raffael Luthiger Nov 08 '13 at 07:04
  • by email types i mean all type of email address e.g user1@gmail.com, user1@yahoo.com, user1@hotmail.com.........something@something.com – Ali Nov 08 '13 at 07:07
  • 1
    A regex like `[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}` should match all email addresses. – Devon Bessemer Nov 08 '13 at 07:23
  • You are awesome Devon :) you made my day. – Ali Nov 08 '13 at 07:33
  • A regex for email is much more longer than this. Have a look at http://stackoverflow.com/a/703068/372239 – Toto Nov 08 '13 at 08:18
  • Yes, it is possible the regex I posted will miss some but I'm pretty sure it covers the large majority. Matching all alphanumeric, ., %, +, -, and _ in the username, matching all alphanumeric, ., and - in the domain. – Devon Bessemer Nov 08 '13 at 22:50