Re: urls.py and adding an OR to the regexp

2008-05-28 Thread Matt Hoskins
On May 28, 2:06 pm, [EMAIL PROTECTED] wrote: > Couldn't you also use something along the lines of > ^price[s]/ > > Though I may have the syntax wrong. Just to correct your syntax the regular expression for making the last letter in that example optional would be: ^prices?/ Matt --~--~

Re: urls.py and adding an OR to the regexp

2008-05-28 Thread Thierry Schork
On Wed, May 28, 2008 at 3:06 PM, <[EMAIL PROTECTED]> wrote: > > Couldn't you also use something along the lines of > ^price[s]/ > > That way you are always matching at least price and will match the > optional s on the end as well. > > Though I may have the syntax wrong. > Yes, it would be ok too

Re: urls.py and adding an OR to the regexp

2008-05-28 Thread titaniumlou
Couldn't you also use something along the lines of ^price[s]/ That way you are always matching at least price and will match the optional s on the end as well. Though I may have the syntax wrong. On May 28, 3:15 am, "Thierry Schork" <[EMAIL PROTECTED]> wrote: > > > It's simply an OR done into t

Re: urls.py and adding an OR to the regexp

2008-05-28 Thread Thierry Schork
> > It's simply an OR done into the matching. Taking the simpliest, I > > would like to implement this regexp: > > ^pric(e|es)/ > > into urls.py, but the () are overlapping with the text capture, as it > > seems. > > If you want to use parentheses that don't capture use "?:" to flag it > as non-gro

Re: urls.py and adding an OR to the regexp

2008-05-28 Thread Matt Hoskins
On May 28, 8:53 am, Thierry <[EMAIL PROTECTED]> wrote: > Hello django users, > > I'm new to django, and I was looking to implement a very simple url > scheme that I used for a PHP site. > It's simply an OR done into the matching. Taking the simpliest, I > would like to implement this regexp: > ^