Robert Menschel wrote:

SARE has been playing around with URI rules lately, and when we need
to test for something in the host/domain area, we use something like:

uri  rule_name  m'(?:https?://)?[^/]*testgoeshere'

I think you want a ^ at the start of your regex. As it is, that will match any string with "testgoeshere" anywhere in it, since the match can start at the "t" rather than at the beginning of the string.

In other words, the test must precede any/all slashes except for those
that might be within http://

When we need to test for something after the host/domain area, we
reverse that, like:

uri rule_name m'(?:https?://)?.+/testgoeshere'

For this I think you want something like

   uri rule_name m'^(?:https?://)?[^/]+/.*testgoeshere'

Without the ^ anchor and without changing . to [^/], you'll match things like 'http://testgoeshere.invalid/path', because the 'http://' part of the regex is optional. And without adding .* after the slash, you won't match things like 'http://example.com/atestgoeshere' -- but maybe you're not wanting to.

--
Keith C. Ivey <[EMAIL PROTECTED]>
Washington, DC

Reply via email to