Re: Regex Validators doesn't validate while working in a shell

2016-09-12 Thread Daniel Roseman
On Monday, 12 September 2016 14:36:23 UTC+1, ashish...@finoit.co.in wrote: > > I've configured user's username field in following way > > username = models.CharField( > _('username'), > max_length=30, > unique=True, > help_text=_('Required. 30 characters or fewer. Le

Re: regex error?

2014-05-07 Thread Sergiy Khohlov
try this one url(r'/(?P\d+)$', DetailView.as_view( model = Customer, template_name="customer.html")), Many thanks, Serge +380 636150445 skype: skhohlov -- You received this message because you are subscribed to the Google Groups "Django users

Re: regex error?

2014-05-06 Thread G Z
ive also tried url(r'^customers/([0-9])/$', DetailView.as_view( model = Customer, template_name="customer.html")), -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

RE: regex

2013-01-25 Thread Babatunde Akinyanmi
'.' matches any character except a new line Sent from my Windows Phone -- From: arm Sent: 1/25/2013 10:09 AM To: django-users@googlegroups.com Subject: regex Hi, I'm trying to figure out the regular expressions that will match any number and punctuation and chars like

Re: regex

2013-01-25 Thread Larry Martell
On Fri, Jan 25, 2013 at 2:09 AM, arm wrote: > > Hi, > > I'm trying to figure out the regular expressions that will match any > number and punctuation and chars like +,#,§ etc . Any advice? http://www.regular-expressions.info/charclass.html -- You received this message because you are subscribe

Re: Regex problem in urls

2010-07-30 Thread Alex Robbins
Based on the urls.py file you are showing us, it seems like /start/ should be a valid url. Are you running the dev server with automatic reloading? Sometimes you need to force a reload on it to see changes. (I normally notice that in the admin, but it could come up anywhere stuff gets cached in me

Re: regex infinite loop with 100% cpu use in django.forms.fields.email_re - DOS hole?

2009-10-12 Thread Tom Evans
On Fri, 2009-10-09 at 12:21 -0700, davisd wrote: > Sorry for the public disclosure... I did email django security after > I posted. I'm just getting into this open source goodness and I'm not > really sure how it's supposed to operate yet. > > I did consult the documentation: > http://docs.dja

Re: regex infinite loop with 100% cpu use in django.forms.fields.email_re - DOS hole?

2009-10-09 Thread Jacob Kaplan-Moss
Just as an update for anyone following this thread: This was indeed a security exploit, and it has been fixed. See http://www.djangoproject.com/weblog/2009/oct/09/security/ for details. Jacob --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: regex infinite loop with 100% cpu use in django.forms.fields.email_re - DOS hole?

2009-10-09 Thread Karen Tracey
On Fri, Oct 9, 2009 at 3:21 PM, davisd wrote: > > I'm wondering if a multithreaded webserver setup would be more guarded > against this sort of thing? > > Yeah, but. When I tried this on my own production server (Apache/mod_wsgi) the process handling the request that caused the problem was kille

Re: regex infinite loop with 100% cpu use in django.forms.fields.email_re - DOS hole?

2009-10-09 Thread davisd
Sorry for the public disclosure... I did email django security after I posted. I'm just getting into this open source goodness and I'm not really sure how it's supposed to operate yet. I did consult the documentation: http://docs.djangoproject.com/en/dev/internals/contributing/ Jacob: I'm run

Re: regex infinite loop with 100% cpu use in django.forms.fields.email_re - DOS hole?

2009-10-09 Thread James Bennett
Yes. We've confirmed the problem. We're working on a patch. In the meantime, everybody go meditate on the documentation for how to report security issues. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ Yo

Re: regex infinite loop with 100% cpu use in django.forms.fields.email_re - DOS hole?

2009-10-09 Thread Juan Hernandez
Take a look at mine: *In [41]: from django.forms.fields django.forms.fields In [41]: from django.forms.fields import email_re In [42]: email_re.match('viewx3dtextx26q...@yahoo.comx26latlngx3d15854521645943074058 ')* and this is what top shows: * PID USER PR NI VIRT RES SHR S %CPU %ME

Re: regex infinite loop with 100% cpu use in django.forms.fields.email_re - DOS hole?

2009-10-09 Thread davisd
Ok! I just confirmed this, I took down a live server! (On of my own) All I had to do was put the email address in the contact form. -David On Oct 9, 1:13 pm, davisd wrote: > After hours of debugging, I found that: > > from django.forms.fields import email_re > email_re.match > ('viewx3dtextx2

Re: regex query delivering incorrect results

2009-09-29 Thread janedenone
Hi Karen, On 28 Sep., 22:49, Karen Tracey wrote: > On Mon, Sep 28, 2009 at 4:00 PM, janedenone wrote: > > > Hi, > > > this > > > pages = Page.objects.exclude(content__iregex=r'^[\n\r \t]*<') > > > should deliver the same rows as this > > > SELECT ... FROM pages WHERE (content NOT REGEXP '^[\n\r

Re: regex query delivering incorrect results

2009-09-28 Thread Karen Tracey
On Mon, Sep 28, 2009 at 4:00 PM, janedenone wrote: > > Hi, > > this > > pages = Page.objects.exclude(content__iregex=r'^[\n\r \t]*<') > > should deliver the same rows as this > > SELECT ... FROM pages WHERE (content NOT REGEXP '^[\n\r \t]*<') > > but it does not: The Django query delivers 468 rows

Re: regex problem in urls.py in Django 1.1/mod_wsgi

2009-09-06 Thread Jim Myers
My noob error: I had extra "portal/" on my regex. Sorry and thanks for your attention. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegro

Re: regex problem in urls.py in Django 1.1/mod_wsgi

2009-09-05 Thread Graham Dumpleton
On Sep 6, 3:52 pm, Karen Tracey wrote: > On Sun, Sep 6, 2009 at 1:36 AM, Jim Myers wrote: > > > Thanks, but that doesn't do it either. > > I changed the regex to: > > > ^portal/student/(?P\S+)/profile_edit/$ > > > and it still doesn't match :( > > It should: > > >>> import re > >>> re.match(r'

Re: regex problem in urls.py in Django 1.1/mod_wsgi

2009-09-05 Thread Karen Tracey
On Sun, Sep 6, 2009 at 1:36 AM, Jim Myers wrote: > > Thanks, but that doesn't do it either. > I changed the regex to: > > ^portal/student/(?P\S+)/profile_edit/$ > > and it still doesn't match :( > > It should: >>> import re >>> re.match(r'^portal/student/(?P\S+)/profile_edit/$', 'portal/student/

Re: regex problem in urls.py in Django 1.1/mod_wsgi

2009-09-05 Thread Jim Myers
Thanks, but that doesn't do it either. I changed the regex to: ^portal/student/(?P\S+)/profile_edit/$ and it still doesn't match :( On Sep 5, 9:44 pm, Karen Tracey wrote: > On Sat, Sep 5, 2009 at 11:32 PM, Jim Myers wrote: > > > Hi, I'm using this regex in urls.py: > > > r'^portal/student/(?P

Re: regex problem in urls.py in Django 1.1/mod_wsgi

2009-09-05 Thread Karen Tracey
On Sat, Sep 5, 2009 at 11:32 PM, Jim Myers wrote: > > Hi, I'm using this regex in urls.py: > > r'^portal/student/(?P\S+)/profile_edit$' > > There's no trailing slash on this regex, but there is an end of string marker ($). So a match will have to end with 'profile_edit', no trailing slash. > to

Re: regex problem in django

2009-06-29 Thread James Gregory
On Jun 29, 2:57 pm, Joru wrote: > Still doesn't work even I remove wrap function :( So it seems your regex is incorrect, the problem is not related to Django. If you paste your code here I can have a look, but I still think you'd be better off reading a bit more about regular expressions yours

Re: regex problem in django

2009-06-29 Thread Joru
Still doesn't work even I remove wrap function :( On Jun 29, 7:35 pm, James Gregory wrote: > On Jun 29, 1:05 pm, Joru wrote: > > > I'm sorry for my typo > > the string var suppose to be like this > > str = "wr:\n one bunny \n two bunny \n wr:\n three bunny \n > > So every match string "wr:" sho

Re: regex problem in django

2009-06-29 Thread James Gregory
On Jun 29, 1:05 pm, Joru wrote: > I'm sorry for my typo > the string var suppose to be like this > str = "wr:\n one bunny \n two bunny \n wr:\n three bunny \n > So every match string "wr:" should had "+" in front of it line > the one that confuse me is that my function work in django/python > s

Re: regex problem in django

2009-06-29 Thread Joru
I'm sorry for my typo the string var suppose to be like this str = "wr:\n one bunny \n two bunny \n wr:\n three bunny \n So every match string "wr:" should had "+" in front of it line the one that confuse me is that my function work in django/python shell, but this regex doesn't work well if i cal

Re: regex problem in django

2009-06-29 Thread James Gregory
On Jun 29, 11:19 am, Joru wrote: > ah, I just want to match in the end of line only > so change the rule "wr$" would get what I want? > > > Square brackets are for character groups, not literal strings. "wr:" > > is just a string so it should be "wr:", not "[wr:]". Also, you want to > > match t

Re: regex problem in django

2009-06-29 Thread Joru
ah, I just want to match in the end of line only so change the rule "wr$" would get what I want? On Jun 29, 4:56 pm, James Gregory wrote: > On Jun 29, 10:49 am, Joru wrote: > > > > > I mean None not null > > When I print rgx always None, that mean theregexeval never match > > The expected outpu

Re: regex problem in django

2009-06-29 Thread James Gregory
On Jun 29, 10:49 am, Joru wrote: > I mean None not null > When I print rgx always None, that mean the regex eval never match > The expected output result would be > > +wr:> one bunny > > two bunny > > + wr: three bunny > > Because everytime found regex rules r'[wr:]$' then should add + in > beg

Re: regex problem in django

2009-06-29 Thread Joru
I mean None not null When I print rgx always None, that mean the regex eval never match The expected output result would be +wr: > one bunny > two bunny + wr: three bunny Because everytime found regex rules r'[wr:]$' then should add + in beginning of line On Jun 29, 4:31 pm, James Gregory wrot

Re: regex problem in django

2009-06-29 Thread James Gregory
On Jun 29, 10:05 am, Joru wrote: > I still can't solve this > Anyone had answer on this? > > On Jun 26, 7:39 pm, Joru wrote: > > > Hi, > > > I experience some weirdness regarding usingregexwith django > > I have following function in utils.py > > > from django.utils.text import wrap > > import r

Re: regex problem in django

2009-06-29 Thread Joru
I still can't solve this Anyone had answer on this? On Jun 26, 7:39 pm, Joru wrote: > Hi, > > I experience some weirdness regarding usingregexwith django > I have following function in utils.py > > from django.utils.text import wrap > import re > > str = "wr: \n one bunny \n two bunny \n wr: thr

Re: Regex pattern for URL matching

2008-10-06 Thread Merrick
I think this is related to WSGI. On Oct 6, 7:17 pm, Merrick <[EMAIL PROTECTED]> wrote: > That is the approach I took and how I resolved the original problem > with the 404. It led me to find that "AllowEncodedSlashes On" in > Apache is needed for encoded slashes to be allowed in the pathname > in

Re: Regex pattern for URL matching

2008-10-06 Thread Merrick
That is the approach I took and how I resolved the original problem with the 404. It led me to find that "AllowEncodedSlashes On" in Apache is needed for encoded slashes to be allowed in the pathname information following the filename. The problem now is that http%3A%2F%2F prints http:/ in my te

Re: Regex pattern for URL matching

2008-10-06 Thread Malcolm Tredinnick
On Mon, 2008-10-06 at 16:10 -0700, Merrick wrote: > keith, thanks for trying. > > %2f is the encoded value of /, but urls contain other characters as > well not just alphanumeric. I think you're debugging the wrong piece of the problem here. Your original regular expression must have been prett

Re: Regex pattern for URL matching

2008-10-06 Thread Merrick
While I have not found the complete solution, I am closer. I added this to my apache settings for the virtual host: AllowEncodedSlashes On I am no longer getting a 404. But even though the url has two instances of %2f to represent two slashes: http://mydomain.com/find/http%3A%2F%2Fwww.wired.com

Re: Regex pattern for URL matching

2008-10-06 Thread Merrick
keith, thanks for trying. %2f is the encoded value of /, but urls contain other characters as well not just alphanumeric. I suspect this issue may have to do with apache or WSGI but not sure what. On Oct 6, 4:06 pm, "Keith Eberle" <[EMAIL PROTECTED]> wrote: > quick solution, i think you could a

Re: Regex pattern for URL matching

2008-10-06 Thread Keith Eberle
quick solution, i think you could add the % to the regex (i'm hardly a regex master): r'^find/(?P[%-\w]+)$ keith On Mon, Oct 6, 2008 at 7:05 PM, Merrick <[EMAIL PROTECTED]> wrote: > > I have narrowed down the problem to %2F in my url, anyone? > > > > On Oct 6, 2:55 pm, Merrick <[EMAIL PROTECT

Re: Regex pattern for URL matching

2008-10-06 Thread Merrick
I have narrowed down the problem to %2F in my url, anyone? On Oct 6, 2:55 pm, Merrick <[EMAIL PROTECTED]> wrote: > \w will only match alphanumeric characters, I need to match anything > and will let my modelform verify that it is indeed a URL. > > On Oct 6, 2:43 pm, Merrick <[EMAIL PROTECTED]>

Re: Regex pattern for URL matching

2008-10-06 Thread Merrick
Thank you, I meant urls.py. APPEND_SLASH = False so I omitted the trailing slash from the regex line: r'^find/(?P[-\w]+)$ and if I pull up the address: http://mydomain.com/find/http%3A%2F%2Fwww.wired.com%2F I still get Not Found The requested URL /find/http://www.wired.com/ was not found on

Re: Regex pattern for URL matching

2008-10-06 Thread Merrick
\w will only match alphanumeric characters, I need to match anything and will let my modelform verify that it is indeed a URL. On Oct 6, 2:43 pm, Merrick <[EMAIL PROTECTED]> wrote: > Thank you, I meant urls.py. APPEND_SLASH = False so I omitted the > trailing slash from the regex line: > > r'^fi

Re: Regex pattern for URL matching

2008-10-06 Thread Keith Eberle
it looks like you have mismatched parens, and no trailing slash, which will matter if APPEND_SLASH = True. the regex should look like: r'^find/(?P[-\w]+)/$' should be urls.py too, not views.py. keith On Mon, Oct 6, 2008 at 1:17 PM, Merrick <[EMAIL PROTECTED]> wrote: > > I am trying to fi

Re: Regex

2008-07-02 Thread Rajesh Dhawan
On Jul 2, 5:33 pm, Ross Dakin <[EMAIL PROTECTED]> wrote: > Followup to clarify. > > If you DON'T use a is_longdistance flag in the model, then you use a > set of rules to determine if a number is long distance when you get > the number out of the db. Sure. Now what if the set of rules you need

Re: Regex

2008-07-02 Thread John Boxall
You might want to refer to this recent article at Coding Horror: http://www.codinghorror.com/blog/archives/001016.html I would stick to what you have. (and I would also only do the calculation once and store it as a boolean field in the database as suggested : ) John On Jun 30, 7:13 am, mike17

Re: Regex

2008-07-02 Thread Ross Dakin
Hi Rajesh, Certainly, best practices are subject to your goals: code maintainability, storage efficiency, execution efficiency, etc. I agree, there are times when it makes sense to store calculated values in a database. I would argue, however, that this inhibits scalability. As a system grows, t

Re: Regex

2008-07-02 Thread Ross Dakin
Followup to clarify. If you DON'T use a is_longdistance flag in the model, then you use a set of rules to determine if a number is long distance when you get the number out of the db. You can avoid this by using a is_longdistance flag in the model, but you're going to have to do the same thing t

Re: Regex

2008-07-02 Thread Rajesh Dhawan
Hi Ross, > I would disagree here. The database should only be used to store raw > data; the database should not know anything about this data (the > database should not be "smart"). > > Determining whether or not a number qualifies as "long distance" is a > job for the domain / controller / view

Re: Regex

2008-07-02 Thread Ross Dakin
> If you have the ability to change your Call model, you should consider > adding a new BooleanField called "is_long_distance" to Call. Then, you > only have to compute it (in Call.save()) when you save or change a > number. That will make your query very simple and efficient. > > -Rajesh D I wou

Re: Regex assistance

2008-07-01 Thread mike171562
Gul, That was it, thx a bunch.. On Jul 1, 10:27 am, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > On Tue, Jul 1, 2008 at 11:15 AM, John Lenton <[EMAIL PROTECTED]> wrote: > >> local numbers start with 281, 832, 713 , or 1281, 1832, or 1713, my > >> regex which isnt working looks like this > > >

Re: Regex assistance

2008-07-01 Thread Marty Alchin
On Tue, Jul 1, 2008 at 11:15 AM, John Lenton <[EMAIL PROTECTED]> wrote: >> local numbers start with 281, 832, 713 , or 1281, 1832, or 1713, my >> regex which isnt working looks like this > > in other words, local numbers match the regex > > r'^(?:281|832|713|1281|1832|1713)' Or, to simplify it e

Re: Regex assistance

2008-07-01 Thread John Lenton
On Tue, Jul 1, 2008 at 12:12, mike171562 <[EMAIL PROTECTED]> wrote: > > Hello, > I am trying to build a regex for a query that excludes local phone > numbers from a list of calls thus leaving only long distance. I dont > have alot of experience with the "re" module > > local numbers start with

Re: Regex

2008-06-30 Thread [EMAIL PROTECTED]
Not that I know of, in the event you need it you can also import QNot from the same place as Q and it does the same thing as ~Q On Jun 30, 12:48 pm, mike171562 <[EMAIL PROTECTED]> wrote: > just wondering, would there be a difference in performance between > using .exclude without the negation or

Re: Regex

2008-06-30 Thread mike171562
just wondering, would there be a difference in performance between using .exclude without the negation or .filter( with the negation? On Jun 30, 12:33 pm, Ayaz Ahmed Khan <[EMAIL PROTECTED]> wrote: > On Jun 30, 10:27 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > > > > > Negation of Q objects

Re: Regex

2008-06-30 Thread Ayaz Ahmed Khan
On Jun 30, 10:27 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > > Negation of Q objects is a recent addition > (seehttp://code.djangoproject.com/ticket/4858).  You must be using a > post-queryset-refactor SVN checkout while the original poster is probably > using a 0.96 release (or an SVN checko

Re: Regex

2008-06-30 Thread Karen Tracey
On Mon, Jun 30, 2008 at 12:27 PM, Ayaz Ahmed Khan <[EMAIL PROTECTED]> wrote: > > On Jun 30, 9:08 pm, mike171562 <[EMAIL PROTECTED]> wrote: > > Thanks that works well, but when I try to use the ~ as you suggested I > > get the error > > ""bad operand type for unary ~: 'Q'"" > > so i removed the ~ a

Re: Regex

2008-06-30 Thread Ayaz Ahmed Khan
On Jun 30, 9:08 pm, mike171562 <[EMAIL PROTECTED]> wrote: > Thanks that works well, but when I try to use the ~ as you suggested I > get the error > ""bad operand type for unary ~: 'Q'"" > so i removed the ~ and changed 'filter' to 'exclude' > That is weird. The negation operator works fine here

Re: Regex

2008-06-30 Thread mike171562
Thanks that works well, but when I try to use the ~ as you suggested I get the error ""bad operand type for unary ~: 'Q'"" so i removed the ~ and changed 'filter' to 'exclude' On Jun 30, 9:53 am, Ayaz Ahmed Khan <[EMAIL PROTECTED]> wrote: > On Jun 30, 7:13 pm, mike171562 <[EMAIL PROTECTED]> wrote

Re: Regex

2008-06-30 Thread Ayaz Ahmed Khan
On Jun 30, 7:13 pm, mike171562 <[EMAIL PROTECTED]> wrote: > Hello, >    I am working on a django that querys long distance numbers from a > mysql database. I am currently using the django API, that goes > something like this. > > long_distance = > Call.objects.filter(dest_num__startswith='1').filt

Re: Regex

2008-06-30 Thread mike171562
Rajesh D, That would be much simpler, but this is a pre-existing database of call records. thanks On Jun 30, 9:35 am, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > Hi Mike, > > >I am working on a django that querys long distance numbers from a > > mysql database. I am currently using the djang

Re: Regex

2008-06-30 Thread Rajesh Dhawan
Hi Mike, >I am working on a django that querys long distance numbers from a > mysql database. I am currently using the django API, that goes > something like this. > > long_distance = > Call.objects.filter(dest_num__startswith='1').filter(dest_num__gt=6).exclud­e(dest_num__startswith='18').ex

Re: regex works in python, not in django

2008-05-23 Thread skunkwerk
thanks! dumb mistake On May 23, 7:42 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Fri, May 23, 2008 at 10:36 PM, skunkwerk <[EMAIL PROTECTED]> wrote: > > > I'm quite puzzled by this... I have a line of code that is supposed to > > strip a variable of any non-alphanumeric characters (such a

Re: regex works in python, not in django

2008-05-23 Thread Karen Tracey
On Fri, May 23, 2008 at 10:36 PM, skunkwerk <[EMAIL PROTECTED]> wrote: > > I'm quite puzzled by this... I have a line of code that is supposed to > strip a variable of any non-alphanumeric characters (such as > whitespace): > > in my python shell, this works fine: > >>>key4cache = '!yahoo' > >>>re

Re: regex in url

2007-07-17 Thread Jacob Kaplan-Moss
On 7/16/07, james_027 <[EMAIL PROTECTED]> wrote: > Yes I am looking for the explanation of ?P syntax, is this > something related to python's regex or django's own regex. Ned's quick answer below is quite clear, I think, but if you'd like more details from the horse's mouth (as it were), the offi

Re: regex in url

2007-07-17 Thread Ned Batchelder
For a quick answer: (?Pxxx) means: "match xxx, and store it as a value named blah in the result". This lets the regex machinery build a set of name/value pairs suitable for use as arguments to a view function. --Ned. james_027 wrote: > hi kenneth, > > thanks a lot, i think should be looking

Re: regex in url

2007-07-16 Thread james_027
hi kenneth, thanks a lot, i think should be looking at official python doc more than the dive into python. cheers, james On Jul 17, 12:47 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > On 17-Jul-07, at 9:36 AM, james_027 wrote: > > > Yes I am looking for the explanation of ?P syntax, is thi

Re: regex in url

2007-07-16 Thread Kenneth Gonsalves
On 17-Jul-07, at 9:36 AM, james_027 wrote: > Yes I am looking for the explanation of ?P syntax, is this > something related to python's regex or django's own regex. python -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~-~--~~~-

Re: regex in url

2007-07-16 Thread james_027
Yes I am looking for the explanation of ?P syntax, is this something related to python's regex or django's own regex. thanks james On Jul 17, 11:57 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 7/17/07, james_027 <[EMAIL PROTECTED]> wrote: > > > I am very new to django as well as py

Re: regex in url

2007-07-16 Thread Russell Keith-Magee
On 7/17/07, james_027 <[EMAIL PROTECTED]> wrote: > I am very new to django as well as python. how is it that ?P > seems to be ignore by the regex function? I can't see any explanation > in django's documentation. is this something magic or hack my django? What do you mean by ignored? Are you get

Re: Regex

2007-02-13 Thread kbochert
On Feb 13, 11:13 am, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > On 2/13/07, kbochert <[EMAIL PROTECTED]> wrote: > > > Given the urlhttp://127.0.0.1:8000/mysite.news.htm > > > then in urls.py > > > (r'^polls/(?P[a-z.]+)', 'Mysite.polls.views.news'), > > #displays page properly, but without the g

Re: Regex

2007-02-13 Thread Jeremy Dunck
On 2/13/07, kbochert <[EMAIL PROTECTED]> wrote: > > > Given the url http://127.0.0.1:8000/mysite.news.htm > > then in urls.py > > (r'^polls/(?P[a-z.]+)', 'Mysite.polls.views.news'), > #displays page properly, but without the graphics ... I don't think so, unless something odd is going on. How doe

Re: regex: how to do this in one line of code?

2006-07-02 Thread nkeric
James Bennett wrote: > The fact that you've got three different regular expressions with > three different substitutions to do means that this needs to be three > logical operations. However, you can make this slightly easier on > yourself by building a dictionary of the patterns and substitutions

Re: regex: how to do this in one line of code?

2006-07-02 Thread James Bennett
On 7/2/06, nkeric <[EMAIL PROTECTED]> wrote: > I'm quite a newbie to regex, could the above code be done in a single > line of regex replacing? The fact that you've got three different regular expressions with three different substitutions to do means that this needs to be three logical operation