Perl expresion /.*/ bug on field type textarea?

13 years 3 months ago #150895 by NicoFaaij
Hi,

I use a 250 character textfield where users can write a introduction about themself, which is shown on the list view.

Now some users enters a newline in that textfield and mess up the list view by making their block very heigh. It should not work as I use the Authorized input Perl expresion /.*/ This should allow anything except a newline. But however, giving an enter still result in a newline.

Does somebody know how to avoid newline's in a field type "textfield"?

Thanks in advance,
Nico

Please Log in to join the conversation.

13 years 3 months ago - 13 years 3 months ago #150904 by krileon
In REGEX "." means anything, line-break, special characters.. anything. You can review more on regex at the following URL.

www.regular-expressions.info/tutorial.html

You should configure it to use Multiple words with spacing to achieve what you're wanting.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

13 years 3 months ago - 13 years 3 months ago #150910 by NicoFaaij
Thank for your quick responce but see also on that site www.regular-expressions.info/dot.html in the second/third line stands

The dot matches a single character, without caring what that character is. The only exception are newline characters. In all regex flavors discussed in this tutorial, the dot will not match a newline character by default. So by default, the dot is short for the negated character class [^\n] (UNIX regex flavors) or [^\r\n] (Windows regex flavors).


Do you know another regular expression to avoid newline/returns?

Please Log in to join the conversation.

13 years 3 months ago - 13 years 3 months ago #151375 by NicoFaaij
Can you please tell my how?

You should configure it to use Multiple words with spacing to achieve what you're wanting.

I still not able to avoid, or even better remove, line-breaks in a CB Textfield? Can you help my?

Many thanks in advance,
Nico

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.208 seconds

Facebook Twitter LinkedIn