Regular Expressions 101

Community Library

Community Library Entry

2

Regular ExpressionOpen Workspace

`
^((.{0,4})|(/api[^/].*)|(/ap[^i].*)|(/a[^p].*)|(/[^a].*))$
`
gm

Description
Created·2023-04-21 10:28
Type·Unit Tests
Flavor·Golang

Aquivalent solution for golang's unsupported negative lookahead in re2 flavor of go's regex. This example provides a negative lookahead similar to (?!/api/) ignoring routes with the /api/ prefix at the start.

Submitted by misha
Open Workspace