Re: matching a domain name in urls.py

2011-02-03 Thread Tom Evans
2011/2/3 Łukasz Rekucki : > On 3 February 2011 17:52, Tom Evans wrote: >> >> . matches any character, not just dot. Your class '[.\w]+' will >> actually match anything and everything. I think you want '[\.\w]'. >> > > Not if used in a character class:

Re: matching a domain name in urls.py

2011-02-03 Thread Łukasz Rekucki
> On Thu, Feb 3, 2011 at 4:50 PM, mike171562 wrote: >> I think i got it now with >> >> (r'^zones/(?P[.\w]+)/$', get_domain) Depending on what you plan to do with the matched string later, you may want to limit it to 256 characters or incorporate some more checks,

Re: matching a domain name in urls.py

2011-02-03 Thread Cal Leeming [Simplicity Media Ltd]
Here you go: http://www.regexbuddy.com/screen.html On Thu, Feb 3, 2011 at 4:55 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > Hi Mike, > > May I suggest RegexBuddy for anything regex related in the future, it have > saved me a *lot* of time! > > Cal > > >

Re: matching a domain name in urls.py

2011-02-03 Thread Cal Leeming [Simplicity Media Ltd]
Hi Mike, May I suggest RegexBuddy for anything regex related in the future, it have saved me a *lot* of time! Cal On Thu, Feb 3, 2011 at 4:44 PM, mike171562 wrote: > I am building an app that passes a domain name to urls.py like so "/ > sites/domain.com/' > > but

Re: matching a domain name in urls.py

2011-02-03 Thread Tom Evans
On Thu, Feb 3, 2011 at 4:50 PM, mike171562 wrote: > I think i got it now with > > (r'^zones/(?P[.\w]+)/$', get_domain) > > . matches any character, not just dot. Your class '[.\w]+' will actually match anything and everything. I think you want '[\.\w]'. Cheers Tom

Re: matching a domain name in urls.py

2011-02-03 Thread Jirka Vejrazka
> I am building an app that passes a domain name to urls.py like so   "/ > sites/domain.com/' > > but I cannot get my urls.py to match the 'domain.com'  it only seems > to match if i just use domain without the dot > > I have tried > >    (r'^zones/^[^/]+/', get_domain), >    (r'^zones/(?P\w+)/',

Re: matching a domain name in urls.py

2011-02-03 Thread mike171562
I think i got it now with (r'^zones/(?P[.\w]+)/$', get_domain) On Feb 3, 10:44 am, mike171562 wrote: > I am building an app that passes a domain name to urls.py like so   "/ > sites/domain.com/' > > but I cannot get my urls.py to match the 'domain.com'  it only

matching a domain name in urls.py

2011-02-03 Thread mike171562
I am building an app that passes a domain name to urls.py like so "/ sites/domain.com/' but I cannot get my urls.py to match the 'domain.com' it only seems to match if i just use domain without the dot I have tried (r'^zones/^[^/]+/', get_domain), (r'^zones/(?P\w+)/', get_domain),