Page 1 of 1
special host matching syntax for (a.b or *.a.b)
Posted: Sun Feb 21, 2010 8:25 pm
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)
Re: special host matching syntax for (a.b or *.a.b)
Posted: Sun Feb 21, 2010 8:28 pm
by Giorgio Maone
Sounds like a neat idea, thanks.
Re: special host matching syntax for (a.b or *.a.b)
Posted: Fri Feb 26, 2010 3:33 pm
by Giorgio Maone
Re: special host matching syntax for (a.b or *.a.b)
Posted: Fri Feb 26, 2010 9:47 pm
by al_9x
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.
Re: special host matching syntax for (a.b or *.a.b)
Posted: Fri Feb 26, 2010 11:33 pm
by Giorgio Maone
al_9x wrote:
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.
Re: special host matching syntax for (a.b or *.a.b)
Posted: Fri Feb 26, 2010 11:52 pm
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.
Re: special host matching syntax for (a.b or *.a.b)
Posted: Sat Feb 27, 2010 12:04 am
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?
Re: special host matching syntax for (a.b or *.a.b)
Posted: Sat Feb 27, 2010 12:35 am
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.
Re: special host matching syntax for (a.b or *.a.b)
Posted: Sat Feb 27, 2010 1:03 am
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).
Re: special host matching syntax for (a.b or *.a.b)
Posted: Sat Feb 27, 2010 1:37 am
by Giorgio Maone