special host matching syntax for (a.b or *.a.b)
special host matching syntax for (a.b or *.a.b)
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)
*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
- 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)
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
- 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)
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
Re: special host matching syntax for (a.b or *.a.b)
I tried it in abe (accept from), resulted in a syntax error (no viable alternative at character '.')Giorgio Maone wrote:Done in 1.9.9.49.
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
- 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)
It's actually a current limit in ABE's grammar which I overlooked, sorry.al_9x wrote:I tried it in abe (accept from), resulted in a syntax error (no viable alternative at character '.')Giorgio Maone wrote:Done in 1.9.9.49.
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
Re: special host matching syntax for (a.b or *.a.b)
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
- 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)
Doesn't it get highlighted in red when a parsing error happens?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.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
Re: special host matching syntax for (a.b or *.a.b)
I wasn't clear when the rules were parsed, is it only when the option dialog is opened or focused?Giorgio Maone wrote:Doesn't it get highlighted in red when a parsing error happens?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.
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
- 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)
Yes. I can try adding an alert in that phase, if an error is found (keeping the highlight).al_9x wrote: I wasn't clear when the rules were parsed, is it only when the option dialog is opened or focused?
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
- 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)
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