August 2, 200619 yr Newbies I need to search a database of over 15,000 records to find email addresses that contain the @ symbol twice within the field. The second "@" is not immediately next to the first "@". I cannot figure out how to get this search in correctly. Any help is greatly appreciated. Thanks in advance.
August 2, 200619 yr Author Newbies I tried *@*@ but it didn't work. (I know that I have at least one occurrence of the double @ in an email field, but this didn't find it.) But thank you for your help! Any other suggestions? If I can't come up with something, I am going to have to manually look through the 510 page report (my head hurts just thinking about that...).
August 2, 200619 yr You should be able to do this in a text editor. If you can post a real sample of data, I'll work out the pattern to find and replace using Regular Expressions in a Grep, in TextWrangler (Free text editor from Bare Bones Software). and post them back for you. HTH Lee
August 2, 200619 yr Try ==*@*@* as the search to find them, I think your previous search will only find words, you need to search over the full field value since @ is a word-break.
August 2, 200619 yr *@*@ finds: @@ @@a @a@ a@@ a@@bc a@b@ a@b@c Can you give an example of text that should have been found, but wasn't?
August 3, 200619 yr I stand corrected, apparently the find is smarter than that, it does find them across words. The data must have had newlines in it, that's the only thing that doesn't seem to work without the ==.
August 3, 200619 yr Interesting. I didn't know that "zero or more characters" does NOT include ¶. But I don't see how adding == helps, on the contrary: ==*@*@ does NOT find: a@b@c a@b b@a Both of these are found by plain *@*@. The string a@b¶a@c is NOT found with or without the ==. Very peculiar, thanks for pointing this out.
August 3, 200619 yr You need to add the final star yourself when using ==, so if you use: ==*@*@* it will find those also. == is a request to search the entire field contents, where normal searches only search words or values (newlines separate values). Edited August 3, 200619 yr by Guest
August 3, 200619 yr Hmm... There's still something weird going on here. What you say makes sense: a "normal" search should not cross word/value boundaries. So *X*X* does NOT find "aXa aXa", nor "aXa¶aXa". But it seems like replacing X with a word-delimiting character (other than space) is messing up the rules, because */*/* DOES FIND "a/a a/a", but NOT "a/a¶a/a" (two values). Edited August 4, 200619 yr by Guest Fixed a typo
August 4, 200619 yr I think its changing the search based on the fact that "/" is a word-break, so it ups your search to be on values. Searching for "*a*a*" doesn't find "/a/ /a/" which just reverses the two characters.
August 4, 200619 yr Yes, another undocumented peculiarity to be aware of. So you were right the first time (at least methodically) and mine was a fluke.
Create an account or sign in to comment