Regular Expressions 101

Save & Share

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java 8
  • .NET 7.0 (C#)
  • Rust
  • Regex Flavor Guide

Function

  • Match
  • Substitution
  • List
  • Unit Tests

Tools

Sponsors
There are currently no sponsors. Become a sponsor today!
An explanation of your regex will be automatically generated as you type.
Detailed match information will be displayed here automatically.
  • All Tokens
  • Common Tokens
  • General Tokens
  • Anchors
  • Meta Sequences
  • Quantifiers
  • Group Constructs
  • Character Classes
  • Flags/Modifiers
  • Substitution
  • A single character of: a, b or c
    [abc]
  • A character except: a, b or c
    [^abc]
  • A character in the range: a-z
    [a-z]
  • A character not in the range: a-z
    [^a-z]
  • A character in the range: a-z or A-Z
    [a-zA-Z]
  • Any single character
    .
  • Alternate - match either a or b
    a|b
  • Any whitespace character
    \s
  • Any non-whitespace character
    \S
  • Any digit
    \d
  • Any non-digit
    \D
  • Any word character
    \w
  • Any non-word character
    \W
  • Non-capturing group
    (?:...)
  • Capturing group
    (...)
  • Zero or one of a
    a?
  • Zero or more of a
    a*
  • One or more of a
    a+
  • Exactly 3 of a
    a{3}
  • 3 or more of a
    a{3,}
  • Between 3 and 6 of a
    a{3,6}
  • Start of string
    ^
  • End of string
    $
  • A word boundary
    \b
  • Non-word boundary
    \B

Regular Expression

/
/
g

Test String

Code Generator

Generated Code

$re = '/([1-9]|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3}\/\d+/'; $str = 'LG MegaFon Looking Glass - show bgp 10.249.0.0/16 Router: MSK-VRR-1 Moscow Command: show route protocol bgp 10.249.0.0/16 table bgp.l3vpn.0 det | no-more bgp.l3vpn.0: 228890 destinations, 628337 routes (227275 active, 0 holddown, 5064 hidden) Restart Complete 83.149.11.41:100:10.249.50.224/29 (3 entries, 1 announced) *BGP Preference: 169/-201 Route Distinguisher: 83.149.11.41:100 Next hop type: Indirect Address: 0xa68a78c Next-hop reference count: 267 Source: 83.149.11.251 Protocol next hop: 83.149.11.41 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Active Ext ProtectionPath ProtectionCand> Local AS: 31133 Peer AS: 25159 Age: 2w2d 16:57:04 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.251+??? Announcement bits (1): 0-BGP_RT_Background AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 83.149.11.251 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.41:100 Next hop type: Indirect Address: 0xa68a78c Next-hop reference count: 267 Source: 83.149.11.252 Protocol next hop: 83.149.11.41 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Ext ProtectionPath ProtectionCand> Inactive reason: Route Preference Local AS: 31133 Peer AS: 25159 Age: 2w2d 16:57:04 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.252+??? AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 83.149.11.252 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.41:100 Next hop type: Indirect Address: 0xa68a78c Next-hop reference count: 267 Source: 10.222.253.245 Protocol next hop: 83.149.11.41 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <NotBest Int Ext ProtectionPath ProtectionCand> Inactive reason: Not Best in its group - Interior > Exterior > Exterior via Interior Local AS: 31133 Peer AS: 31133 Age: 2w2d 16:57:04 Metric2: 1 Validation State: unverified Task: BGP_31133.10.222.253.245+??? AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 10.222.253.245 83.149.11.41:100:10.249.50.232/29 (3 entries, 1 announced) *BGP Preference: 169/-201 Route Distinguisher: 83.149.11.41:100 Next hop type: Indirect Address: 0xa68a78c Next-hop reference count: 267 Source: 83.149.11.251 Protocol next hop: 83.149.11.41 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Active Ext ProtectionPath ProtectionCand> Local AS: 31133 Peer AS: 25159 Age: 2w2d 16:57:04 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.251+??? Announcement bits (1): 0-BGP_RT_Background AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 83.149.11.251 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.41:100 Next hop type: Indirect Address: 0xa68a78c Next-hop reference count: 267 Source: 83.149.11.252 Protocol next hop: 83.149.11.41 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Ext ProtectionPath ProtectionCand> Inactive reason: Route Preference Local AS: 31133 Peer AS: 25159 Age: 2w2d 16:57:04 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.252+??? AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 83.149.11.252 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.41:100 Next hop type: Indirect Address: 0xa68a78c Next-hop reference count: 267 Source: 10.222.253.245 Protocol next hop: 83.149.11.41 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <NotBest Int Ext ProtectionPath ProtectionCand> Inactive reason: Not Best in its group - Interior > Exterior > Exterior via Interior Local AS: 31133 Peer AS: 31133 Age: 2w2d 16:57:04 Metric2: 1 Validation State: unverified Task: BGP_31133.10.222.253.245+??? AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 10.222.253.245 83.149.11.41:100:10.249.50.248/29 (3 entries, 1 announced) *BGP Preference: 169/-201 Route Distinguisher: 83.149.11.41:100 Next hop type: Indirect Address: 0xa68a78c Next-hop reference count: 267 Source: 83.149.11.251 Protocol next hop: 83.149.11.41 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Active Ext ProtectionPath ProtectionCand> Local AS: 31133 Peer AS: 25159 Age: 2w2d 16:57:04 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.251+??? Announcement bits (1): 0-BGP_RT_Background AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 83.149.11.251 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.41:100 Next hop type: Indirect Address: 0xa68a78c Next-hop reference count: 267 Source: 83.149.11.252 Protocol next hop: 83.149.11.41 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Ext ProtectionPath ProtectionCand> Inactive reason: Route Preference Local AS: 31133 Peer AS: 25159 Age: 2w2d 16:57:04 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.252+??? AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 83.149.11.252 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.41:100 Next hop type: Indirect Address: 0xa68a78c Next-hop reference count: 267 Source: 10.222.253.245 Protocol next hop: 83.149.11.41 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <NotBest Int Ext ProtectionPath ProtectionCand> Inactive reason: Not Best in its group - Interior > Exterior > Exterior via Interior Local AS: 31133 Peer AS: 31133 Age: 2w2d 16:57:04 Metric2: 1 Validation State: unverified Task: BGP_31133.10.222.253.245+??? AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 10.222.253.245 83.149.11.41:100:10.249.150.224/29 (3 entries, 1 announced) *BGP Preference: 169/-201 Route Distinguisher: 83.149.11.41:100 Next hop type: Indirect Address: 0xa68a78c Next-hop reference count: 267 Source: 83.149.11.251 Protocol next hop: 83.149.11.41 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Active Ext ProtectionPath ProtectionCand> Local AS: 31133 Peer AS: 25159 Age: 2w2d 16:57:04 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.251+??? Announcement bits (1): 0-BGP_RT_Background AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 83.149.11.251 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.41:100 Next hop type: Indirect Address: 0xa68a78c Next-hop reference count: 267 Source: 83.149.11.252 Protocol next hop: 83.149.11.41 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Ext ProtectionPath ProtectionCand> Inactive reason: Route Preference Local AS: 31133 Peer AS: 25159 Age: 2w2d 16:57:04 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.252+??? AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 83.149.11.252 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.41:100 Next hop type: Indirect Address: 0xa68a78c Next-hop reference count: 267 Source: 10.222.253.245 Protocol next hop: 83.149.11.41 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <NotBest Int Ext ProtectionPath ProtectionCand> Inactive reason: Not Best in its group - Interior > Exterior > Exterior via Interior Local AS: 31133 Peer AS: 31133 Age: 2w2d 16:57:04 Metric2: 1 Validation State: unverified Task: BGP_31133.10.222.253.245+??? AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 10.222.253.245 83.149.11.41:100:10.249.150.232/29 (3 entries, 1 announced) *BGP Preference: 169/-201 Route Distinguisher: 83.149.11.41:100 Next hop type: Indirect Address: 0xa68a78c Next-hop reference count: 267 Source: 83.149.11.251 Protocol next hop: 83.149.11.41 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Active Ext ProtectionPath ProtectionCand> Local AS: 31133 Peer AS: 25159 Age: 2w2d 16:57:04 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.251+??? Announcement bits (1): 0-BGP_RT_Background AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 83.149.11.251 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.41:100 Next hop type: Indirect Address: 0xa68a78c Next-hop reference count: 267 Source: 83.149.11.252 Protocol next hop: 83.149.11.41 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Ext ProtectionPath ProtectionCand> Inactive reason: Route Preference Local AS: 31133 Peer AS: 25159 Age: 2w2d 16:57:04 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.252+??? AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 83.149.11.252 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.41:100 Next hop type: Indirect Address: 0xa68a78c Next-hop reference count: 267 Source: 10.222.253.245 Protocol next hop: 83.149.11.41 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <NotBest Int Ext ProtectionPath ProtectionCand> Inactive reason: Not Best in its group - Interior > Exterior > Exterior via Interior Local AS: 31133 Peer AS: 31133 Age: 2w2d 16:57:04 Metric2: 1 Validation State: unverified Task: BGP_31133.10.222.253.245+??? AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 10.222.253.245 83.149.11.42:100:10.249.50.224/29 (3 entries, 1 announced) *BGP Preference: 169/-201 Route Distinguisher: 83.149.11.42:100 Next hop type: Indirect Address: 0xa68ab1c Next-hop reference count: 258 Source: 83.149.11.251 Protocol next hop: 83.149.11.42 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Active Ext ProtectionPath ProtectionCand> Local AS: 31133 Peer AS: 25159 Age: 2w2d 16:56:39 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.251+??? Announcement bits (1): 0-BGP_RT_Background AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 83.149.11.251 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.42:100 Next hop type: Indirect Address: 0xa68ab1c Next-hop reference count: 258 Source: 83.149.11.252 Protocol next hop: 83.149.11.42 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Ext ProtectionPath ProtectionCand> Inactive reason: Route Preference Local AS: 31133 Peer AS: 25159 Age: 2w2d 16:56:39 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.252+??? AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 83.149.11.252 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.42:100 Next hop type: Indirect Address: 0xa68ab1c Next-hop reference count: 258 Source: 10.222.253.245 Protocol next hop: 83.149.11.42 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <NotBest Int Ext ProtectionPath ProtectionCand> Inactive reason: Not Best in its group - Interior > Exterior > Exterior via Interior Local AS: 31133 Peer AS: 31133 Age: 2w2d 16:56:39 Metric2: 1 Validation State: unverified Task: BGP_31133.10.222.253.245+??? AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 10.222.253.245 83.149.11.42:100:10.249.50.232/29 (3 entries, 1 announced) *BGP Preference: 169/-201 Route Distinguisher: 83.149.11.42:100 Next hop type: Indirect Address: 0xa68ab1c Next-hop reference count: 258 Source: 83.149.11.251 Protocol next hop: 83.149.11.42 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Active Ext ProtectionPath ProtectionCand> Local AS: 31133 Peer AS: 25159 Age: 2w2d 16:56:39 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.251+??? Announcement bits (1): 0-BGP_RT_Background AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 83.149.11.251 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.42:100 Next hop type: Indirect Address: 0xa68ab1c Next-hop reference count: 258 Source: 83.149.11.252 Protocol next hop: 83.149.11.42 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Ext ProtectionPath ProtectionCand> Inactive reason: Route Preference Local AS: 31133 Peer AS: 25159 Age: 2w2d 16:56:39 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.252+??? AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 83.149.11.252 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.42:100 Next hop type: Indirect Address: 0xa68ab1c Next-hop reference count: 258 Source: 10.222.253.245 Protocol next hop: 83.149.11.42 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <NotBest Int Ext ProtectionPath ProtectionCand> Inactive reason: Not Best in its group - Interior > Exterior > Exterior via Interior Local AS: 31133 Peer AS: 31133 Age: 2w2d 16:56:39 Metric2: 1 Validation State: unverified Task: BGP_31133.10.222.253.245+??? AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 10.222.253.245 83.149.11.42:100:10.249.50.248/29 (3 entries, 1 announced) *BGP Preference: 169/-201 Route Distinguisher: 83.149.11.42:100 Next hop type: Indirect Address: 0xa68ab1c Next-hop reference count: 258 Source: 83.149.11.251 Protocol next hop: 83.149.11.42 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Active Ext ProtectionPath ProtectionCand> Local AS: 31133 Peer AS: 25159 Age: 2w2d 16:56:39 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.251+??? Announcement bits (1): 0-BGP_RT_Background AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 83.149.11.251 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.42:100 Next hop type: Indirect Address: 0xa68ab1c Next-hop reference count: 258 Source: 83.149.11.252 Protocol next hop: 83.149.11.42 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Ext ProtectionPath ProtectionCand> Inactive reason: Route Preference Local AS: 31133 Peer AS: 25159 Age: 2w2d 16:56:39 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.252+??? AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 83.149.11.252 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.42:100 Next hop type: Indirect Address: 0xa68ab1c Next-hop reference count: 258 Source: 10.222.253.245 Protocol next hop: 83.149.11.42 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <NotBest Int Ext ProtectionPath ProtectionCand> Inactive reason: Not Best in its group - Interior > Exterior > Exterior via Interior Local AS: 31133 Peer AS: 31133 Age: 2w2d 16:56:39 Metric2: 1 Validation State: unverified Task: BGP_31133.10.222.253.245+??? AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 10.222.253.245 83.149.11.42:100:10.249.150.224/29 (3 entries, 1 announced) *BGP Preference: 169/-201 Route Distinguisher: 83.149.11.42:100 Next hop type: Indirect Address: 0xa68ab1c Next-hop reference count: 258 Source: 83.149.11.251 Protocol next hop: 83.149.11.42 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Active Ext ProtectionPath ProtectionCand> Local AS: 31133 Peer AS: 25159 Age: 2w2d 16:56:39 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.251+??? Announcement bits (1): 0-BGP_RT_Background AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 83.149.11.251 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.42:100 Next hop type: Indirect Address: 0xa68ab1c Next-hop reference count: 258 Source: 83.149.11.252 Protocol next hop: 83.149.11.42 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Ext ProtectionPath ProtectionCand> Inactive reason: Route Preference Local AS: 31133 Peer AS: 25159 Age: 2w2d 16:56:39 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.252+??? AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 83.149.11.252 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.42:100 Next hop type: Indirect Address: 0xa68ab1c Next-hop reference count: 258 Source: 10.222.253.245 Protocol next hop: 83.149.11.42 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <NotBest Int Ext ProtectionPath ProtectionCand> Inactive reason: Not Best in its group - Interior > Exterior > Exterior via Interior Local AS: 31133 Peer AS: 31133 Age: 2w2d 16:56:39 Metric2: 1 Validation State: unverified Task: BGP_31133.10.222.253.245+??? AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 10.222.253.245 83.149.11.42:100:10.249.150.232/29 (3 entries, 1 announced) *BGP Preference: 169/-201 Route Distinguisher: 83.149.11.42:100 Next hop type: Indirect Address: 0xa68ab1c Next-hop reference count: 258 Source: 83.149.11.251 Protocol next hop: 83.149.11.42 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Active Ext ProtectionPath ProtectionCand> Local AS: 31133 Peer AS: 25159 Age: 2w2d 16:56:39 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.251+??? Announcement bits (1): 0-BGP_RT_Background AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 83.149.11.251 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.42:100 Next hop type: Indirect Address: 0xa68ab1c Next-hop reference count: 258 Source: 83.149.11.252 Protocol next hop: 83.149.11.42 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Ext ProtectionPath ProtectionCand> Inactive reason: Route Preference Local AS: 31133 Peer AS: 25159 Age: 2w2d 16:56:39 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.252+??? AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 83.149.11.252 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.42:100 Next hop type: Indirect Address: 0xa68ab1c Next-hop reference count: 258 Source: 10.222.253.245 Protocol next hop: 83.149.11.42 Push 17 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <NotBest Int Ext ProtectionPath ProtectionCand> Inactive reason: Not Best in its group - Interior > Exterior > Exterior via Interior Local AS: 31133 Peer AS: 31133 Age: 2w2d 16:56:39 Metric2: 1 Validation State: unverified Task: BGP_31133.10.222.253.245+??? AS path: 25159 ? Communities: 31133:100 target:25159:25159 target:64690:100 target:64999:15 Accepted VPN Label: 17 Localpref: 200 Router ID: 10.222.253.245 83.149.11.65:1065:10.249.28.168/29 (3 entries, 1 announced) *BGP Preference: 169/-201 Route Distinguisher: 83.149.11.65:1065 Next hop type: Indirect Address: 0xa68bcec Next-hop reference count: 3 Source: 83.149.11.251 Protocol next hop: 83.149.11.65 Push 27775 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Active Ext ProtectionPath ProtectionCand> Local AS: 31133 Peer AS: 25159 Age: 28w0d 0:58:33 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.251+??? Announcement bits (1): 0-BGP_RT_Background AS path: 25159 ? Communities: 25159:64666 31133:100 target:64999:1065 Accepted VPN Label: 27775 Localpref: 200 Router ID: 83.149.11.251 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.65:1065 Next hop type: Indirect Address: 0xa68bcec Next-hop reference count: 3 Source: 83.149.11.252 Protocol next hop: 83.149.11.65 Push 27775 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Ext ProtectionPath ProtectionCand> Inactive reason: Route Preference Local AS: 31133 Peer AS: 25159 Age: 28w0d 0:58:44 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.252+??? AS path: 25159 ? Communities: 25159:64666 31133:100 target:64999:1065 Accepted VPN Label: 27775 Localpref: 200 Router ID: 83.149.11.252 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.65:1065 Next hop type: Indirect Address: 0xa68bcec Next-hop reference count: 3 Source: 10.222.253.245 Protocol next hop: 83.149.11.65 Push 27775 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <NotBest Int Ext ProtectionPath ProtectionCand> Inactive reason: Not Best in its group - Interior > Exterior > Exterior via Interior Local AS: 31133 Peer AS: 31133 Age: 12w0d 2:17:42 Metric2: 1 Validation State: unverified Task: BGP_31133.10.222.253.245+??? AS path: 25159 ? Communities: 25159:64666 31133:100 target:64999:1065 Accepted VPN Label: 27775 Localpref: 200 Router ID: 10.222.253.245 83.149.11.66:1065:10.249.28.168/29 (3 entries, 1 announced) *BGP Preference: 169/-201 Route Distinguisher: 83.149.11.66:1065 Next hop type: Indirect Address: 0x9ed8860 Next-hop reference count: 3 Source: 83.149.11.251 Protocol next hop: 83.149.11.66 Push 27764 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Active Ext ProtectionPath ProtectionCand> Local AS: 31133 Peer AS: 25159 Age: 28w0d 0:58:34 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.251+??? Announcement bits (1): 0-BGP_RT_Background AS path: 25159 ? Communities: 25159:64666 31133:100 target:64999:1065 Accepted VPN Label: 27764 Localpref: 200 Router ID: 83.149.11.251 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.66:1065 Next hop type: Indirect Address: 0x9ed8860 Next-hop reference count: 3 Source: 83.149.11.252 Protocol next hop: 83.149.11.66 Push 27764 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Ext ProtectionPath ProtectionCand> Inactive reason: Route Preference Local AS: 31133 Peer AS: 25159 Age: 28w0d 0:58:49 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.252+??? AS path: 25159 ? Communities: 25159:64666 31133:100 target:64999:1065 Accepted VPN Label: 27764 Localpref: 200 Router ID: 83.149.11.252 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.66:1065 Next hop type: Indirect Address: 0x9ed8860 Next-hop reference count: 3 Source: 10.222.253.245 Protocol next hop: 83.149.11.66 Push 27764 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <NotBest Int Ext ProtectionPath ProtectionCand> Inactive reason: Not Best in its group - Interior > Exterior > Exterior via Interior Local AS: 31133 Peer AS: 31133 Age: 12w0d 2:17:42 Metric2: 1 Validation State: unverified Task: BGP_31133.10.222.253.245+??? AS path: 25159 ? Communities: 25159:64666 31133:100 target:64999:1065 Accepted VPN Label: 27764 Localpref: 200 Router ID: 10.222.253.245 83.149.11.101:1039:10.249.64.0/18 (3 entries, 1 announced) *BGP Preference: 170/-101 Route Distinguisher: 83.149.11.101:1039 Next hop type: Indirect Address: 0x10fb4d20 Next-hop reference count: 12 Source: 83.149.11.252 Protocol next hop: 83.149.11.101 Push 63 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Active Ext ProtectionPath ProtectionCand> Local AS: 31133 Peer AS: 25159 Age: 8w5d 3:07:17 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.252+??? Announcement bits (1): 0-BGP_RT_Background AS path: 25159 64626 ? Communities: 31133:100 target:64999:1039 Accepted VPN Label: 63 Localpref: 100 Router ID: 83.149.11.252 BGP Preference: 170/-101 Route Distinguisher: 83.149.11.101:1039 Next hop type: Indirect Address: 0x10fb4d20 Next-hop reference count: 12 Source: 83.149.11.251 Protocol next hop: 83.149.11.101 Push 63 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <NotBest Ext ProtectionPath ProtectionCand> Inactive reason: Not Best in its group - Active preferred Local AS: 31133 Peer AS: 25159 Age: 8w5d 3:07:17 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.251+??? AS path: 25159 64626 ? Communities: 31133:100 target:64999:1039 Accepted VPN Label: 63 Localpref: 100 Router ID: 83.149.11.251 BGP Preference: 170/-101 Route Distinguisher: 83.149.11.101:1039 Next hop type: Indirect Address: 0x10fb4d20 Next-hop reference count: 12 Source: 10.222.253.245 Protocol next hop: 83.149.11.101 Push 63 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <NotBest Int Ext ProtectionPath ProtectionCand> Inactive reason: Not Best in its group - Interior > Exterior > Exterior via Interior Local AS: 31133 Peer AS: 31133 Age: 8w5d 3:07:17 Metric2: 1 Validation State: unverified Task: BGP_31133.10.222.253.245+??? AS path: 25159 64626 ? Communities: 31133:100 target:64999:1039 Accepted VPN Label: 63 Localpref: 100 Router ID: 10.222.253.245 83.149.11.120:196:10.249.109.0/24 (3 entries, 1 announced) *BGP Preference: 169/-201 Route Distinguisher: 83.149.11.120:196 Next hop type: Indirect Address: 0x11399fd4 Next-hop reference count: 6 Source: 83.149.11.251 Protocol next hop: 83.149.11.120 Push 33 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Active Ext ProtectionPath ProtectionCand> Local AS: 31133 Peer AS: 25159 Age: 11w2d 1:53:58 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.251+??? Announcement bits (1): 0-BGP_RT_Background AS path: 25159 I Communities: 31133:100 target:64999:196 Accepted VPN Label: 33 Localpref: 200 Router ID: 83.149.11.251 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.120:196 Next hop type: Indirect Address: 0x11399fd4 Next-hop reference count: 6 Source: 83.149.11.252 Protocol next hop: 83.149.11.120 Push 33 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <Ext ProtectionPath ProtectionCand> Inactive reason: Route Preference Local AS: 31133 Peer AS: 25159 Age: 11w2d 1:53:58 Metric2: 1 Validation State: unverified Task: BGP_25159.83.149.11.252+??? AS path: 25159 I Communities: 31133:100 target:64999:196 Accepted VPN Label: 33 Localpref: 200 Router ID: 83.149.11.252 BGP Preference: 170/-201 Route Distinguisher: 83.149.11.120:196 Next hop type: Indirect Address: 0x11399fd4 Next-hop reference count: 6 Source: 10.222.253.245 Protocol next hop: 83.149.11.120 Push 33 Indirect next hop: 0x2 no-forward INH Session ID: 0x0 State: <NotBest Int Ext ProtectionPath ProtectionCand> Disclaimer: All commands will be logged for possible later analysis and statistics. If you don\'t like this policy, please disconnect now! Please email questions or comments to noc@megafon.ru. '; preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0); // Print the entire match result var_dump($matches);

Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php