Welcome, Guest
Username: Password: Remember me

TOPIC: regular expression help

regular expression help 3 years 3 months ago #63841

  • mattias
  • mattias's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 77
  • Karma: 1
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: 3 years 3 months ago by mattias.
The administrator has disabled public write access.

Re: regular expression help 3 years 3 months ago #63842

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2950
  • Thank you received: 377
  • Karma: 124
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re: regular expression help 3 years 3 months ago #63843

  • mattias
  • mattias's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 77
  • Karma: 1
my friend, probe which tells me but I worked the field that I am using is free text.

greetings and thanks for comment
The administrator has disabled public write access.

Re: regular expression help 3 years 3 months ago #63844

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2950
  • Thank you received: 377
  • Karma: 124
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.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re: regular expression help 3 years 3 months ago #63845

  • mattias
  • mattias's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 77
  • Karma: 1
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
pantalla.jpg
Last Edit: 3 years 3 months ago by mattias.
The administrator has disabled public write access.

Re: regular expression help 3 years 3 months ago #63846

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2950
  • Thank you received: 377
  • Karma: 124
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?

:-)
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re: regular expression help 3 years 3 months ago #63847

  • mattias
  • mattias's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 77
  • Karma: 1
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).
The administrator has disabled public write access.

Re: regular expression help 3 years 3 months ago #63848

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2950
  • Thank you received: 377
  • Karma: 124
Que exactamente no funciona?
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re: regular expression help 3 years 3 months ago #63908

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4357
  • Thank you received: 826
  • Karma: 381
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: regular expression help 3 years 3 months ago #63916

  • mattias
  • mattias's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 77
  • Karma: 1
muchas gracias ,

saludos
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.119 seconds
Donation Image