\{\{\.Resp(\d+)_([\w-\.]+)\}\}
as \{\{\.Resp(\d+)_([\w-.]+)\}\}
118 }
119}
120
121var reMergeKey = regexp.MustCompile(`\{\{\.Resp(\d+)_([\w-\.]+)\}\}`)122
123func sequentialMerge(reqCloner func(*Request) *Request, patterns []string, timeout time.Duration, rc ResponseCombiner, next ...Proxy) Proxy {
124 return func(ctx context.Context, request *Request) (*Response, error) {
^(resp[\d]+_.+)?(JWT\.([\w\-\.:/]+))?$
as ^(resp\d+_.+)?(JWT\.([\w\-.:/]+))?$
366
367var (
368 simpleURLKeysPattern = regexp.MustCompile(`\{([\w\-\.:/]+)\}`)
369 sequentialParamsPattern = regexp.MustCompile(`^(resp[\d]+_.+)?(JWT\.([\w\-\.:/]+))?$`)370 invalidPattern = `^[^/]|\*.|/__(debug|echo|health)(/.*)?$`
371 errInvalidHost = errors.New("invalid host")
372 errInvalidNoOpEncoding = errors.New("can not use NoOp encoding with more than one backends connected to the same endpoint")
\{([\w\-\.:/]+)\}
as \{([\w\-.:/]+)\}
365var ExtraConfigAlias = map[string]string{}
366
367var (
368 simpleURLKeysPattern = regexp.MustCompile(`\{([\w\-\.:/]+)\}`)369 sequentialParamsPattern = regexp.MustCompile(`^(resp[\d]+_.+)?(JWT\.([\w\-\.:/]+))?$`)
370 invalidPattern = `^[^/]|\*.|/__(debug|echo|health)(/.*)?$`
371 errInvalidHost = errors.New("invalid host")
(https?://)?([a-zA-Z0-9\._\-]+)(:[0-9]{2,6})?/?
as (https?://)?([a-zA-Z0-9._\-]+)(:\d{2,6})?/?
10
11var (
12 endpointURLKeysPattern = regexp.MustCompile(`/\{([a-zA-Z\-_0-9]+)\}`)
13 hostPattern = regexp.MustCompile(`(https?://)?([a-zA-Z0-9\._\-]+)(:[0-9]{2,6})?/?`) 14)
15
16// URIParser defines the interface for all the URI manipulation required by KrakenD
Simplified regular expressions make the intent clear while being easier to refactor.
package main
import (
"regexp"
)
func foo() {
_ = regexp.MustCompile(`(?:a|b|c) [a-z][a-z]*`)
}
package main
import (
"regexp"
)
func foo() {
_ = regexp.MustCompile(`[abc] {3}[a-z]+`)
}