Test regular expressions in real time. Built with network engineers in mind — includes BGP community filtering, AS path regex, and JunOS/IOS policy matching examples. Paste your regex, enter test strings, and see matches highlighted instantly.
Regular Expression
/
/
Test Strings
Highlighted Matches
Results will appear here as you type…
BGP & Network Examples (click to load)
^Start of string/line
$End of string/line
.Any single character
*Zero or more
+One or more
?Zero or one
[abc]Character class
[^abc]Negated class
[0-9]Digit range
\dAny digit (0-9)
\wWord char (a-z,0-9,_)
\sWhitespace
(abc)Capture group
a|bOR
{n,m}Between n and m times
(?:abc)Non-capturing group
^65000:Communities from AS 65000
:100$Value ending in 100
^65000:1[0-9]{2}$65000:100-199
:(100|200|300)$Specific values
^65[0-9]{3}:[0-9]+$Any 65xxx ASN
^[0-9]{1,5}:[0-9]{1,5}$Valid community format
^target:[0-9]+:[0-9]+$Route-target ext community
^[0-9]+:[0-9]+:[0-9]+$Large community (RFC 8092)
^$Locally originated (empty)
^65000$Directly from AS 65000 only
(^| )65000( |$)Passes through 65000
^65000 First AS is 65000
65000$Origin AS is 65000
_65[0-9]{3}_Any 65xxx AS in path
^65000( 65000)*$65000 with prepends only
([0-9]+) \1Detect prepend (repeated AS)
JunOS uses POSIX ERE for community matching in policy. The underscore _ in AS path regex matches any delimiter. Use community matches in term conditions.
^65000:.*Any community from 65000
.*:100$Any ASN, value 100
target:[0-9]+:[0-9]+Route-target ext community
origin:[0-9]+:[0-9]+Route-origin ext community
large:[0-9]+:[0-9]+:[0-9]+Large community
_65000_AS path through 65000