Regex constraint

Some people, when confronted with a problem, think "I know, I'll use
regular expressions." Now they have two problems.
-- Jamie Zawinski

Don't constrain names. It's more trouble than it's worth and your
regex will certainly not capture all the punctuation or random
characters that names can contain. See
http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/

As to the problem at hand, pyxform doesn't support quotes. You'll have
to edit the XML and type it there, and even then, you might have to do
some trial and error to get it to behave well.

I've filed this as a bug at
https://github.com/XLSForm/pyxform/issues/11. No ETA for a fix.

Yaw

··· -- Need ODK services? http://nafundi.com provides form design, server setup, professional support, and software development for ODK.

On Thu, Sep 11, 2014 at 2:11 AM, chiume.ling@gmail.com wrote:

Hi Yaw,

I am developing a questionnaire that captures names of places and people. As a way of ensuring correctness and/or validity of the entries, I have decided to use Regular Expressions to define what characters are acceptable.

For my scenario, I would like to allowa single quote (') in the names, for names such as O'Brian.

I am using XLSForm and the contraint would be something like regex(, '[1]+$').

When I try to convert that, I get an error and I think it's becasue of the single quote in the middle. I tried using double quotes but kept getting the same error.

I need help with defining such a regular expression in XLSForm.

Many thanks.

Lingstone S. Chiume

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups "ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


  1. \p{L} .'- ↩︎

1 Like