0

I have a huge number of approximately 4000 contacts. I imported most of my Facebook contacts into my main address book in Google, but now I have contacts with a special field "Facebook : facebook.pseudonym", which is unusable, and I want to transform all of them in mail address like facebook.pseudonym@facebook.com, that I can use in my newsletters.

In order to do that, I tried with Komodo to use regex in their "find & replace" to select the field after ",Facebook," but as there is sometime an EOL, sometime a comma, sometime something else.

Could you help me find the good expression to reorganize all my contacts ?

Thanks, Yann

Yannovitch
  • 101
  • 1
  • Komodo comes with excellent Rx Toolkit, which you could use to perfect your regex (it is better to teach you how to fish, rather than give you just one fish). – mvp Oct 31 '13 at 06:03

1 Answers1

0

Try using the following regex:

(,)Facebook\s+:\s(?\w+.\w+)

I used Rubular to test the regex. I'm not sure if it will works for python.

Augusto Pedraza
  • 538
  • 3
  • 18
  • Assuming that you could have some string like: Facebook : facebook.pseudonym afas , Facebook : facebook.pseudonym Facebook : facebook.pseudonym , Facebook : facebook.pseudonym ,Facebook : facebook.pseudonym The regex that works to get the contact name is: **(,)*Facebook\s+:\s*(\w+.\w+)** I tested this regex [here](http://www.pythonregex.com/) The regex is the same just have not use named captured grouping. I hope this works for you!!! – Augusto Pedraza Oct 31 '13 at 12:39