REGEX Query

Discussion in 'IT & Internet' started by Ozzy, Jun 29, 2021.

  1. Ozzy

    Ozzy Founder of UKBF UKBF Staff
    Verified Business ✔️
    Contributor

    4,119 709
    Looking for the REGEX guru's as I need to apply a filter. Looking to capture;

    %N(N)+N(N)@gmail

    So that's anything followed by either one or two numerical digits, followed by a + symbol, followed by another one or two numerical digits, followed by @gmail.com
     
    Posted: Jun 29, 2021 By: Ozzy Member since: Feb 9, 2003
    #1
  2. zigojacko

    zigojacko Verified Business ✔️
    Contributor

    3,748 1,212
    Can you provide an actual example?

    It sounds like something along the lines of:-

    ?
     
    Posted: Jun 30, 2021 By: zigojacko Member since: Dec 7, 2009
    #2
  3. Ozzy

    Ozzy Founder of UKBF UKBF Staff
    Verified Business ✔️
    Contributor

    4,119 709
    Thanks.
    I'll drop you a DM once this task I'm doing completes with couple examples as these are email addresses, so can't post on a public forum.
     
    Posted: Jun 30, 2021 By: Ozzy Member since: Feb 9, 2003
    #3
  4. zigojacko

    zigojacko Verified Business ✔️
    Contributor

    3,748 1,212
    Yeh sure, no probs - but don't need an actual real example, just an example of the format like my post above.
     
    Posted: Jun 30, 2021 By: zigojacko Member since: Dec 7, 2009
    #4
  5. Ozzy

    Ozzy Founder of UKBF UKBF Staff
    Verified Business ✔️
    Contributor

    4,119 709
    Posted: Jun 30, 2021 By: Ozzy Member since: Feb 9, 2003
    #5
  6. DontAsk

    DontAsk Contributor

    2,141 360
    Posted: Jun 30, 2021 By: DontAsk Member since: Jan 7, 2015
    #6
    • Thanks Thanks x 2
    • Useful Useful x 1
  7. zigojacko

    zigojacko Verified Business ✔️
    Contributor

    3,748 1,212
    Beat me to it above.

    But yeah, there you go @Ozzy
     
    Posted: Jun 30, 2021 By: zigojacko Member since: Dec 7, 2009
    #7
    • Thanks Thanks x 1
  8. gpietersz

    gpietersz Full Member
    Contributor

    2,222 562
    Unicode characters can occour in the local part, and its possible to write it a bit more concisely, so you might be better off with:

    ^\w+\d+\+\[email protected]$

    The \w matches any letter and \d matches any digit. There might still be a risk of dots or numbers eairler in the address, so you might want:

    .+\d+\+\[email protected]$
     
    Posted: Jun 30, 2021 By: gpietersz Member since: Sep 10, 2019
    #8
  9. Ozzy

    Ozzy Founder of UKBF UKBF Staff
    Verified Business ✔️
    Contributor

    4,119 709
    Thank you chaps. Will add this into the spam filters for UKBF later :)
     
    Posted: Jun 30, 2021 By: Ozzy Member since: Feb 9, 2003
    #9
  10. SEO Developer

    SEO Developer UKBF Regular

    266 38
    Posted: Jun 30, 2021 By: SEO Developer Member since: Jun 8, 2021
    #10
  11. JEREMY HAWKE

    JEREMY HAWKE Verified Business ✔️
    Full Member
    Contributor

    6,110 2,266
    Yes they are lovely watches but you got the spelling wrong
     
    Posted: Jun 30, 2021 By: JEREMY HAWKE Member since: Mar 4, 2008
    #11
    • Thanks Thanks x 2