#15093: smart_split behaviour is surprising
-------------------------------------------+--------------------------------
               Reporter:  steveire         |         Owner:  nobody
                 Status:  new              |     Milestone:        
              Component:  Template system  |       Version:  1.2   
             Resolution:                   |      Keywords:        
           Triage Stage:  Accepted         |     Has patch:  1     
    Needs documentation:  0                |   Needs tests:  0     
Patch needs improvement:  0                |  
-------------------------------------------+--------------------------------
Changes (by ersame):

  * has_patch:  0 => 1


Comment:

 Hi there,

 I have solved the problem. I have almost read a book about regular
 expression to solve the problem but it was quite interesting :)

 I have made some test using steveire report:

 {{{
 In [3]: list(smart_split(r'This is "a person\'s" test.')) == [u'This',
 u'is', u'"a person\\\'s"', u'test.']
 Out[3]: True

 In [4]: list(smart_split(r"Another 'person\'s' test.")) == [u'Another',
 u"'person\\'s'", u'test.']
 Out[4]: True

 In [5]: list(smart_split(r'A "\"funky\" style" test.')) == [u'A',
 u'"\\"funky\\" style"', u'test.']
 Out[5]: True

 In [6]: list(smart_split(r' now "j "n" Y"')) == [u'now', u'"j "', u'n',
 u'" Y"']
 Out[6]: True

 In [7]: list(smart_split(r' now "j "n " Y"')) == [u'now', u'"j "', u'n',
 u'" Y"']
 Out[7]: True

 In [8]: list(smart_split(r' now "j " n" Y"')) == [u'now', u'"j "', u'n',
 u'" Y"']
 Out[8]: True

 In [9]: list(smart_split(r' now "j " n " Y"')) == [u'now', u'"j "', u'n',
 u'" Y"']
 Out[9]: True
 }}}

 Thank you for the report steveire.

 Regards,

 Juan Antonio Infantes.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15093#comment:2>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to