Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

regular expression help ?

  • 26-10-2006 04:11PM
    #1
    Registered Users, Registered Users 2 Posts: 1,127 ✭✭✭


    Hi..

    Admitted, havent a clue. Im trying to check through a file which contains domain names, and I want to isolate three-letter .com domain names. Dont ask why, I've asked, and I havent got a proper answer yet.. : )

    Anyhow, Im using Textpad, so I can use regexp to search. But whats the string..

    is it something like

    s/[a-z]{3}/\.com/

    im talking through my arse now.. any ideas?

    I want to search for "abc.com" where abc is any combination of alphabetic-only characters. There's no preceding characters. the line starts with the domain name.

    Thanks
    Stephen


Comments

  • Closed Accounts Posts: 286 ✭✭Kev


    The regular expression would be [a-zA-Z]{3}\.com
    I'm not sure what you need to wrap around it in textpad though


  • Registered Users, Registered Users 2 Posts: 2 d1nam0


    Hate to be a know it all but if ya do this on a unix platform the command is simply

    grep "^:alnum:\{3\}\.com" filename.txt > results.out

    (change the figure in the command to determine the length of the required expression)




    Ps....1 hour please :):)


  • Registered Users, Registered Users 2 Posts: 5,112 ✭✭✭Blowfish


    d1nam0 wrote:
    Hate to be a know it all but if ya do this on a unix platform the command is simply

    grep "^:alnum:\{3\}\.com" filename.txt > results.out
    Well unfortunately Textpad is only available for windows.


Advertisement