Hi,

I'm trying to match a number using word boundaries like so

                            record = SipClient.objects.get(
                                dnlist__iregex='\b%s\b' % dn
                                )

but this is failing to find simple dnlist matches like 1234, while this
does work fine in a python shell.

>>> SipClient.objects.get(dnlist__iregex='71065')
<SipClient: SipClient: 71065>
>>> SipClient.objects.get(dnlist__iregex='\b71065\b')
Traceback (most recent call last):
  File "<console>", line 1, in ?
  File "/usr/lib/python2.4/site-packages/django/db/models/manager.py",
line 132, in get
    return self.get_query_set().get(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/django/db/models/query.py",
line 348, in get
    raise self.model.DoesNotExist("%s matching query does not exist."
DoesNotExist: SipClient matching query does not exist.

and yet

>>> import re
>>> re.match(r'\b71065\b', '71065')
<_sre.SRE_Match object at 0xb7f01f38>

I'm using postgresql for my db.

Any ideas why this would not work?

Thanks,
Mike

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to