Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help - How can I find two occurences of a character within a field?

Featured Replies

  • 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.

Try searching for: *@*@

  • 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...).

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

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.

*@*@ 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?

  • Author
  • Newbies

==*@*@* worked! Thank you so much for the help.

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 ==.

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.

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 by Guest

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 by Guest
Fixed a typo

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.

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

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.