special host matching syntax for (a.b or *.a.b)

Bug reports and enhancement requests
Post Reply
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

special host matching syntax for (a.b or *.a.b)

Post by al_9x »

This is a common enough pattern to deserve special syntactic sugar.

*a.b is not correct as it marches ha.b
^(.*\.)?a\.b$ is correct but overkill for a simple concept
how about .a.b to match (a.b or *.a.b)
Last edited by al_9x on Mon Feb 22, 2010 6:56 am, edited 1 time in total.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: special host matching syntax for (a.b or *.a.b)

Post by Giorgio Maone »

Sounds like a neat idea, thanks.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: special host matching syntax for (a.b or *.a.b)

Post by Giorgio Maone »

Done in 1.9.9.49.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: special host matching syntax for (a.b or *.a.b)

Post by al_9x »

Giorgio Maone wrote:Done in 1.9.9.49.
I tried it in abe (accept from), resulted in a syntax error (no viable alternative at character '.')

I guess this disables all the rules? There should be an alert of some kind. I thought the new syntax was working because the request was allowed but it was allowed because the rules could not be parsed and were not active.
Last edited by al_9x on Sat Feb 27, 2010 2:42 am, edited 1 time in total.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: special host matching syntax for (a.b or *.a.b)

Post by Giorgio Maone »

al_9x wrote:
Giorgio Maone wrote:Done in 1.9.9.49.
I tried it in abe (accept from), resulted in a syntax error (no viable alternative at character '.')
It's actually a current limit in ABE's grammar which I overlooked, sorry.
The AddressMatcher shortcut is working fine (e.g. in HTTPS enforcing or in Clickjacking exceptions), but ABE can't parse the whole rule because its grammar doesn't allow site patterns to start with "." (yet).
Will be fixed in next dev build.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: special host matching syntax for (a.b or *.a.b)

Post by al_9x »

Do you think it's worth having an alert when abe parsing fails? I'd like to know if the rules aren't active.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: special host matching syntax for (a.b or *.a.b)

Post by Giorgio Maone »

al_9x wrote:Do you think it's worth having an alert when abe parsing fails? I'd like to know if the rules aren't active.
Doesn't it get highlighted in red when a parsing error happens?
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: special host matching syntax for (a.b or *.a.b)

Post by al_9x »

Giorgio Maone wrote:
al_9x wrote:Do you think it's worth having an alert when abe parsing fails? I'd like to know if the rules aren't active.
Doesn't it get highlighted in red when a parsing error happens?
I wasn't clear when the rules were parsed, is it only when the option dialog is opened or focused?

If so, then there is no need for an alert, but when closing the options and there is an error you should switch to it and not close. Otherwise you can (modify, open, close) or (open, modify, close) without seeing the error.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: special host matching syntax for (a.b or *.a.b)

Post by Giorgio Maone »

al_9x wrote: I wasn't clear when the rules were parsed, is it only when the option dialog is opened or focused?
Yes. I can try adding an alert in that phase, if an error is found (keeping the highlight).
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: special host matching syntax for (a.b or *.a.b)

Post by Giorgio Maone »

Fixed in 1.9.9.50
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
Post Reply