- Posts: 4
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
My regular expression don't work. Someboy can help-me? Thanks.
- diegoaraujocastro
- Topic Author
- Offline
- New Member
Less
More
7 years 3 months ago #145230
by diegoaraujocastro
My regular expression don't work. Someboy can help-me? Thanks. was created by diegoaraujocastro
Dear friends,
I need to validate a process number with 17 digits:
99999.999999/9999-99.
This expression works:
/^[0-9]{5}\.[0-9]{6}\/[0-9]{4}-[0-9]{2}$/
BUT the problem is that user need to add dots, bars and trace manually.
When I try to exclude "\" before these elements, like the example below, I didn't take the same result:
Number:
999.999.999-99.
Validation: /^[0-9]{3}.[0-9]{3}.[0-9]{3}-[0-9]{2}$/
In this example. the user have points e trace autofill.
I know that I put a number more than 3 in the validation formula don't work.
There is a solution to add dots, bars and traces automatically when the user insert the information (in the first example)?
Thanks a lot!
I need to validate a process number with 17 digits:
99999.999999/9999-99.
This expression works:
/^[0-9]{5}\.[0-9]{6}\/[0-9]{4}-[0-9]{2}$/
BUT the problem is that user need to add dots, bars and trace manually.
When I try to exclude "\" before these elements, like the example below, I didn't take the same result:
Number:
999.999.999-99.
Validation: /^[0-9]{3}.[0-9]{3}.[0-9]{3}-[0-9]{2}$/
In this example. the user have points e trace autofill.
I know that I put a number more than 3 in the validation formula don't work.
There is a solution to add dots, bars and traces automatically when the user insert the information (in the first example)?
Thanks a lot!
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10629
- Thank you received: 3696
7 years 3 months ago #145265
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic My regular expression don't work. Someboy can help-me? Thanks.
A regex can't insert characters for you. You'll need to use an input mask -
digitalbush.com/projects/masked-input-plugin/
.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10629
- Thank you received: 3696
7 years 3 months ago #145268
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic My regular expression don't work. Someboy can help-me? Thanks.
...or this one -
github.com/RobinHerbots/Inputmask
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
7 years 3 months ago #145348
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic My regular expression don't work. Someboy can help-me? Thanks.
Note for me : plugin idea
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- diegoaraujocastro
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
7 years 3 months ago #145371
by diegoaraujocastro
Replied by diegoaraujocastro on topic My regular expression don't work. Someboy can help-me? Thanks.
Dear friends,
Thanks for help.
Unfortunately, I don't have acess to limesurvey's directory: only the webpage.
In the second example, why it works? Maybe have a input mask for this in the code?
Thanks.
Thanks for help.
Unfortunately, I don't have acess to limesurvey's directory: only the webpage.
In the second example, why it works? Maybe have a input mask for this in the code?
Thanks.
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10629
- Thank you received: 3696
7 years 3 months ago #145376
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic My regular expression don't work. Someboy can help-me? Thanks.
I have no clue how a validation regex could insert characters.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- diegoaraujocastro
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
7 years 3 months ago #145377
by diegoaraujocastro
In the fisrt pic below, I start do type 002 and the dot is automaticaly completed:
In example, I start do type "002.831. (and these dots are automaticaly completed)
In validate regx we have the code of second pic of these post.
Its probable that have a plugin code with CPF mask in the limesurvey's folder?
Thanks
Replied by diegoaraujocastro on topic My regular expression don't work. Someboy can help-me? Thanks.
I have no clue how a validation regex could insert characters.
In the fisrt pic below, I start do type 002 and the dot is automaticaly completed:
In example, I start do type "002.831. (and these dots are automaticaly completed)
In validate regx we have the code of second pic of these post.
Its probable that have a plugin code with CPF mask in the limesurvey's folder?
Thanks
Attachments:
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10629
- Thank you received: 3696
7 years 3 months ago #145383
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic My regular expression don't work. Someboy can help-me? Thanks.
I don't know of any masks like that in the core LimeSurvey code and cannot reproduce it on any of my versions.
What version are you using?
What template are you using?
Have you tested with the default template?
Can you attach a small sample survey?
What version are you using?
What template are you using?
Have you tested with the default template?
Can you attach a small sample survey?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- diegoaraujocastro
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
7 years 3 months ago #145391
by diegoaraujocastro
Replied by diegoaraujocastro on topic My regular expression don't work. Someboy can help-me? Thanks.
What version are you using? 2.05+ Build 141229
What template are you using? It's a template especific for my organization, but I imagine that the almost modification are only in design.
Have you tested with the default template? Only now. Are your a genious! In default template, limesurvey didnt't autocomplete like second example of my topic. I'll need to contact my IT area to modify lime template and include this mask, it's out of my control.
Congratulations! Finally I can discovery the cause of my regex don't work like other type of number in my form.
God bless you!
What template are you using? It's a template especific for my organization, but I imagine that the almost modification are only in design.
Have you tested with the default template? Only now. Are your a genious! In default template, limesurvey didnt't autocomplete like second example of my topic. I'll need to contact my IT area to modify lime template and include this mask, it's out of my control.
Congratulations! Finally I can discovery the cause of my regex don't work like other type of number in my form.
God bless you!
Attachments:
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12779
- Thank you received: 3940
7 years 3 months ago #145399
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic My regular expression don't work. Someboy can help-me? Thanks.
Hi, diego,
well, just to remind:
there is a topic in the manual about masked input
manual.limesurvey.org/Workarounds:_Manip...asks_-_second_method
Best regards
Joffm
well, just to remind:
there is a topic in the manual about masked input
manual.limesurvey.org/Workarounds:_Manip...asks_-_second_method
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.