Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Regex cheat-sheet

TokenDescription
.any single character
\dany number
\hany horizontal white-space (space, tab, etc.)
TokenDescription
?one or zero times
*any number of times (even zero - zero or more times)
+at least once (one or more times)
{2}Repeats 2 times
TokenDescription
[abc]any of the characters inside ('a' or 'b' or 'c')
[a-z]

any of the characters inside the range (a through z)

|or
()group - for example '(foo|bar)' - 'foo' or 'bar'

Regex search examples

Find any vlan with IDs 1020 or 1030:

vlan (1020|1030)

 

Find any vlan in the 10xx range:

vlan 10\d{2}

 

Find any router with OSPF router-id in 10.0.0.0/24

router-id=10.0.0.\d+

 

  • No labels