You are viewing limited content. For full access, please sign in.

Question

Question

What is the Regular Expression for all UPPERCASE letters on forms?

asked on May 19, 2014

i tried using [A-Z]+ it'll work on a single word ex:  BRENTWOOD but if i put in BRENTWOOD MS its incorrect.  any ideas???

0 0

Answer

APPROVED ANSWER
replied on May 19, 2014

If you want the regular expression to match multiple words, you'll also need to include the space in between the words as an allowed character: [A-Z ]+

 

If you want to allow any whitespace character (e.g., tab or newline), not just spaces, you add \s to the allow characters: [A-Z\s]+

3 0

Replies

replied on August 24, 2016 Show version history

I use the website regex101.com for a quick reference to answering questions like this, and it speeds up the process of testing your expression instead of trying to do it through the LF UI. You can copy and paste your sample text to that site, and see the results of your regex work on the fly.

Once I get everything working the way I like, I copy my completed expression from there back into Laserfiche. When dealing with large blocks of text from doing OCR on an entire page it's a huge time saver.

3 0
replied on May 19, 2014

That regex will match upper case letters, but it doesn't match whitespace (space, tabs, line breaks, etc). Try [A-Z\s]+ and see if that works in your particular case. The \s tells it to look for white space characters.

1 0
replied on May 19, 2014

[A-Z\s]+ worked.  thanks you guys!

1 0
replied on May 19, 2014

regular expressions cant be used on number fields?

0 0
replied on May 19, 2014

Please feel free to ask this question in another thread. Asking a new question instead of putting it in the comments makes it more visible to the people that are answering questions, and makes it easier for others with the same question to find it later!

 

Please also take the time to mark whichever answer on this thread best answered your original question by pressing the "This answered my question" button to the far right of the up/down arrows.

1 0
replied on March 8, 2018

Armando,

I don't know if this helpful, and I can't take credit for it crating the code (I found it in an answer in this forum), but this Javascript is really handy:

 

//Converts text to uppercase if fields CSS Class is set to upperCaseMe
$(document).ready(function(){  
  $('.upperCaseMe input').focusout(function() {
    $( this ).val($( this ).val().toUpperCase());
  });
});

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.