Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

regular expression help ?

Options
  • 26-10-2006 4:11pm
    #1
    Registered Users 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 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 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