# Category: regex

## Regex for Search as you Type

how to Regex for Search as you Type I am trying a regex to use for my search as you type textarea, and I am stuck here: What I want is to show suggestions only when the user types two curly braces, and I don’t know how to achieve it i.e. how to treat the curly braces as a special character in a regex. Can someone help me with this? Source: AngularJS

## How can I modify my regular expression below to block the repetition of characters (not to be repeated more that two times in continuation)?

Below is the regular expression I want to modify to check the repetition of characters for not more than 2 times in continuation, see the below examples for more details. I have the regex for avoiding the repetition but I need both of them in the same expression. (/(.){2}/) For example: Nameee : Invalid, Naaame : Invalid, Name : Valid, Naammee: Valid, Nnname : Invalid. I have ^(?!.*[AaEeIiOoUu]{5}).*[AaEeIiOoUu].*[a-zA-Zu00BF-u1FFFu2C00-uD7FF]*(?:-[a-zA-Zu00BF-u1FFFu2C00-uD7FF]*)?\$ Source: AngularJS

## Return true if three or more repeated chars considering case sensitivity

My current expression is as follows: var temp = “(.)(?:.*1){2}”; var textExp = new RegExp(temp); I need the output : 1> true for Sas 2> true also for SaS Source: AngularJS

## test return false if upper case or number is present in a text

regexp I tried include follows(for upper case). The following returns true self.upperCharCheck = false ; //has to be false by default var temp =”(?=(.*[^A-Z]))”; self.testUpperCase = new RegExp(temp); self.upperCharCheck = (self.testUpperCase.test(self.newPassword)); I want the self.upperCharCheck to be true if no UpperCase is present and false otherwise if uppercase is present. Source: AngularJS

## Restrict typing by RegExp in AngularJS

I coded an angular directive for inhibiting typing from inputs by specifying a regex. In that directive I indicate a regex that will be used for allow the input data. Conceptually, it works fine, but there are two bugs in this solution: In the first Plunker example the input must allow only numbers or numbers followed by a dot [.], or numbers followed by a dot followed by numbers with no more than four digits. […]