Page 1 of 1

Regular Expression to find the first occurence of a word in

Posted: Fri Oct 17, 2008 6:35 pm
by nvedia
Lets say I have this string

firstpartfhttp://domainabc.comhttp://domainxyz.comand this goes on

I need to find the first full domain in this starting with http:// and ending in com
When I search for http://.*.[com] in TextPad, I get the result as

http://domainabc.comhttp://domainxyz.com
But I want the result to be
http://domainabc.com

http://([a-z]([a-z0-9-]*[a-z0-9])?\.(com|net|org)) seems to work in Perl but not in TextPad
Please help

Posted: Fri Oct 17, 2008 10:10 pm
by ben_josephs
Use Posix regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
Doesn't
http://[^:]+\.(com|net|org)
do what you want more simply?