Re: [squid-users] REGEX \w+\d

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Mon, 31 Oct 2011 10:28:22 +1300

 On Sun, 30 Oct 2011 22:29:28 +0200, Ghassan Gharabli wrote:
> Hello Amos,
>
> I am trying to find and match "abc123" only, cache-1 , cdn-1 ,
> videos-1 .
>
> but s/([a-z]*+[0-9]*)/cdn/; is also matching words without digits!!

 That is what '*' means. ZERO or more of the token to its left.

 It will also match "123" without letters.

 *+ is a bit weird. It means ONE or more copies of token with ZERO or
 more letters.
  ie one empty string might match.

>
> I want to match for example ...
> http://(a1.domain.com) not (a.domain.com) so how to restrict it more
> !!?

  s/([a-z]+[0-9]+)/cdn/

 Amos
Received on Sun Oct 30 2011 - 21:28:28 MDT

This archive was generated by hypermail 2.2.0 : Mon Oct 31 2011 - 12:00:03 MDT