BGP AS-Path Regex Tester

Test an AS-path expression against real paths before it goes in a route-map. The underscore _ behaves the way it does on IOS XE, NX-OS and IOS XR: it matches a space, a comma, a brace, a bracket, or the start or end of the path.

ip as-path access-list 10 permit

One path per line, as "show ip bgp" prints it. A blank line is an empty path (a route you originate). The example paths mix private AS numbers with well-known transit and content networks.

Result

    Patterns engineers use most

    Use it

    
            

    On the IOS XE command line, type Ctrl+V before a "?" in an expression, or the CLI shows help instead.

    The characters

    _Start, end, space, comma, brace or bracket. Use it around AS numbers so 645 doesn't match 64512.
    ^ $Start and end of the path. ^$ is an empty path: your own routes.
    .Any single character.
    * + ?Zero or more, one or more, zero or one of what's before it.
    [0-9]Any one digit. [0-9]+ is any AS number.
    ( | )Group and choose: (174|3356) is either AS.