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: # # USE .NET FLAGS: i
x
m
s
 Help SHOW MATCH ARRAY:    EXPLAIN:  OPTIMIZE:    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
 
2
 
3
 
4

Das Modell AB0FF2DE23 ist in Reparatur
Das Modell AB0FF2DE23_2 ist in Reparatur
Das Modell AB0FF2_DE23 ist in Reparatur
Das Modell AB0FF2_DE23_2 ist in Reparatur

RESULTS:

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

Raw Match Pattern:
([A-Z]{2}\d|\d{3}|[A-Z]{3})([A-Z]{4}|[A-Z]{2}\d{1,2}|\d{3}|[A-Z]{3})(_)?([A-Z]\d{3}|[A-Z]{1,3}\d{2}|[A-Z]{3}\d|[A-Z]{4}|\d{3})?(_2)?

Raw Replace Pattern:
\1 \2 \4\5

PHP Code Example:
 
<?php
$sourcestring="your source string";
echo preg_replace('/([A-Z]{2}\d|\d{3}|[A-Z]{3})([A-Z]{4}|[A-Z]{2}\d{1,2}|\d{3}|[A-Z]{3})(_)?([A-Z]\d{3}|[A-Z]{1,3}\d{2}|[A-Z]{3}\d|[A-Z]{4}|\d{3})?(_2)?/','\1 \2 \4\5',$sourcestring);
?>
 

$sourcestring after replacement:
Das Modell AB0 FF2 DE23 ist in Reparatur
Das Modell AB0 FF2 DE23_2 ist in Reparatur
Das Modell AB0 FF2 DE23 ist in Reparatur
Das Modell AB0 FF2 DE23_2 ist in Reparatur