Check out the LimeSurvey source code on GitHub!

regular expression help

More
5 years 7 months ago - 5 years 7 months ago #63841 by mattias01
friends forums

someone could help me with a regular expression to validate the RUT or DNI, in Chile the format is as follows,

11.111.111-1
11.111.111-K

appreciate your help

regards
Last Edit: 5 years 7 months ago by mattias01.

Please Log in to join the conversation.

More
5 years 7 months ago #63842 by holch

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

More
5 years 7 months ago #63843 by mattias01
my friend, probe which tells me but I worked the field that I am using is free text.

greetings and thanks for comment

Please Log in to join the conversation.

More
5 years 7 months ago #63844 by holch

mattias wrote: my friend, probe which tells me but I worked the field that I am using is free text.

greetings and thanks for comment


Hi Mattias, sorry, I don't understand your answer.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

More
5 years 7 months ago - 5 years 7 months ago #63845 by mattias01
use the data that tells me a question such as free text (line), but I worked the expression ^ 0 * (\ d {1,3} (\.? \ d {3}) *) \ -? ([\ dKK]) $.

Health expects to have been a little clearer
Attachments:
Last Edit: 5 years 7 months ago by mattias01.

Please Log in to join the conversation.

More
5 years 7 months ago #63846 by holch
Bueno, yo creo que estas usando Google Translate o algo parecido para escribir aqui. Es casi impossible de entender tus respuestas.

Que tiene la salud a ver con esso aqui?

:-)

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

More
5 years 7 months ago #63847 by mattias01
mil disculpas por mi ingles jaja ! , use la expresion regular que me indicas pero aun asi no me funciona , el campo que utilizo es del tipo texto libre (linea).

Please Log in to join the conversation.

More
5 years 7 months ago #63848 by holch
Que exactamente no funciona?

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

More
5 years 6 months ago #63908 by tpartner
In the question validation field, you need the the slashes before and after the expression.

To match 11.111.111-1 or 11.111.111-K, try:
/^(\d{2})\.(\d{3})\.(\d{3})\.[\dK]$/

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
5 years 6 months ago #63916 by mattias01
muchas gracias ,

saludos

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form