Myregextester.com is the premier online regular expressions tester that allows visitors to construct, test, and optimize regular expressions.

 Click here to manually set the number of rows for match/replacement textareas. Regex Cheat Sheet Regex Tutorials Regex Book

URL SOURCE:   FILE SOURCE:

MATCH PATTERN:

REPLACEMENT PATTERN:

OPERATION: # # FLAGS: i
x
m
s
 Help SHOW MATCH ARRAY:    EXPLAIN:    SHOW CODE: PHP
ASP
VB.NET
C#.NET
Java
JS
DELIM: HIGHLIGHT MATCHES:      GEN SAMPLES:   
    Save example     Help     FROM: TO: 

PASSWORD RESTRICTIONS:

Allow only these characters:  (any character)  ]
At Least  Total Characters
No More Than   Total Characters
At Least  Lowercase Characters (a-z)
At Least  Uppercase Characters (A-Z)
At Least  Numeric Characters (0-9)
At Least  Special Characters in [^a-zA-Z0-9]  ]
Disallow sequential alphanumeric sequences of or more (i.e. 123... abc... ABC...)
Disallow repeating characters of or more (i.e. 11... aa... AA... %%...)

WORD LIST:



SOURCE TEXT:

HIGHLIGHTED MATCHES:

Select All (to copy etc.)
CAPTURE GROUPS Help
0
 
1

Hello there I AM ALL UPPERCASE and NONE of me is LOWERCASE. True? ISN'T IT Not!
Does JOHN'S TEXT ALSO appear AS LOWERCASE or is it MORE mixed.
This is WORTH DESCRIBING! Isn't IT? How about U.S. currency? He is smarter than I.

RESULTS:

Select All (to copy etc.)
Execution Time(sec.):
0.000064

Raw Match Pattern:
((?:[A-Z]\.){2,}|(?:\b[A-Z][A-Z']*\b[?!]?\s*)+)

Java Code Example:

import java.util.regex.Pattern;
import java.util.regex.Matcher;
class Module1{
  public static void main(String[] asd){
  String sourcestring = "source string to match with pattern";
  Pattern re = Pattern.compile("((?:[A-Z]\\.){2,}|(?:\\b[A-Z][A-Z']*\\b[?!]?\\s*)+)");
  Matcher m = re.matcher(sourcestring);
  int mIdx = 0;
    while (m.find()){
      for( int groupIdx = 0; groupIdx < m.groupCount()+1; groupIdx++ ){
        System.out.println( "[" + mIdx + "][" + groupIdx + "] = " + m.group(groupIdx));
      }
      mIdx++;
    }
  }
}


$matches Array:
(
    [0] => Array
        (
            [0] => I AM ALL UPPERCASE 
            [1] => NONE 
            [2] => LOWERCASE
            [3] => ISN'T IT 
            [4] => JOHN'S TEXT ALSO 
            [5] => AS LOWERCASE 
            [6] => MORE 
            [7] => WORTH DESCRIBING! 
            [8] => IT? 
            [9] => U.S.
            [10] => I
        )

    [1] => Array
        (
            [0] => I AM ALL UPPERCASE 
            [1] => NONE 
            [2] => LOWERCASE
            [3] => ISN'T IT 
            [4] => JOHN'S TEXT ALSO 
            [5] => AS LOWERCASE 
            [6] => MORE 
            [7] => WORTH DESCRIBING! 
            [8] => IT? 
            [9] => U.S.
            [10] => I
        )

)