need some regex help for homesite 5.5

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

need some regex help for homesite 5.5

Post by Burrito »

I'm not 100% sure which regex engine homesite natively uses. I know it can use the posix engine, but I also know it has some PCREesque characteristics as well.

in any case. I need a regular expression to find email addresses that start with support@ but have different domain names than domainx.com.

in other words, I might have 15 documents with email addresses in them:

support@mydomain.com
support@blingbling.com
support@whatever.com
support@domainx.com
support@blahbling.com
....

of those listed, all but 1 would match. (the support@domainx.com).

can anyone assist with this?

thx,

Burr
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

why not just search out "support@"?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

because then I'll have literally tens of thousands of matches and I don't want to have to weed through them all to find out which ones are NOT support@domainx.com.

I only want to list out the ones that are NOT support@domainx.com.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Ahh, I misread your post before. I thought you wanted all the support addresses. Didn't see the exclusionary bit.

From looking at a few pages, I don't think Homesite supports assertions.

If you used grep, you could write an assertion:

Code: Select all

[feyd@home]>more addresses.txt
support@mydomain.com
support@blingbling.com
support@whatever.com
support@domainx.com
support@blahbling.com

[feyd@home]>grep -Pin "^support@(?!domainx\.com)" addresses.txt
1:support@mydomain.com
2:support@blingbling.com
3:support@whatever.com
5:support@blahbling.com
Post Reply