100+ results for 'regex ansi lang:go'

Not the results you expected?

name.go (https://github.com/coredns/coredns.git) Go · 289 lines

39 type regexNameRule struct {

40 NextAction string

41 Pattern *regexp.Regexp

42 Replacement string

43 ResponseRule

55 // RegexMatch matches when the name in the question section of a request matches a regular expression

56 RegexMatch = "regex"

57 )

58

279 // isValidRegexPattern returns a regular expression for pattern matching or errors, if any.

280 func isValidRegexPattern(rewriteFrom, rewriteTo string) (*regexp.Regexp, error) {

281 rewriteFromPattern, err := regexp.Compile(rewriteFrom)

284 }

285 if getSubExprUsage(rewriteTo) > rewriteFromPattern.NumSubexp() {

286 return nil, fmt.Errorf("the rewrite regex pattern (%s) uses more subexpressions than its corresponding matching regex pattern (%s)", rewriteTo, rewriteFrom)

287 }

288 return rewriteFromPattern, nil

doc.go (https://github.com/paralect/mongo.git) Go · 116 lines

44 // 9. BSON datetime unmarshals to a primitive.Datetime.

45 // 10. BSON binary unmarshals to a primitive.Binary.

46 // 11. BSON regular expression unmarshals to a primitive.Regex.

47 // 12. BSON JavaScript unmarshals to a primitive.JavaScript.

48 // 13. BSON code with scope unmarshals to a primitive.CodeWithScope.

tls.pb.validate.go (https://github.com/knative/pkg.git) Go · 544 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

25 _ = fmt.Print

26 _ = utf8.UTFMax

27 _ = (*regexp.Regexp)(nil)

28 _ = (*strings.Reader)(nil)

29 _ = net.IPv4len

go1pkgrename.go (https://github.com/xushiwei/go.old.git) Go · 146 lines

18 "2011-11-08",

19 go1pkgrename,

20 `Rewrite imports for packages moved during transition to Go 1.

21

22 http://codereview.appspot.com/5316078

93 {"go/typechecker", ""},

94 {"old/netchan", ""},

95 {"old/regexp", ""},

96 {"old/template", ""},

97 {"try", ""},

util.go (https://gitlab.com/vitalii.dr/chezmoi) Go · 190 lines

3 import (

4 "fmt"

5 "regexp"

6 "strconv"

7 "strings"

12

13 var (

14 goVersionRx = regexp.MustCompile(`\Ago(\d+)(?:\.(\d+)(?:\.(\d+))?)?\z`)

15

16 wellKnownAbbreviations = map[string]struct{}{

169

170 // validateKeys ensures that all keys in data match re.

171 func validateKeys(data interface{}, re *regexp.Regexp) error {

172 switch data := data.(type) {

173 case map[string]interface{}:

testing.go (https://bitbucket.org/pizzafactory/pf-gcc.git) Go · 174 lines

145 matched, err := matchString(*match, tests[i].Name)

146 if err != nil {

147 println("invalid regexp for -match:", err.String())

148 os.Exit(1)

149 }

mysql.go (https://gitlab.com/jamesclonk-io/moviedb-backend) Go · 179 lines

11 "github.com/mattes/migrate/file"

12 "github.com/mattes/migrate/migrate/direction"

13 "regexp"

14 "strconv"

15 "strings"

110

111 if isErr {

112 re, err := regexp.Compile(`at line ([0-9]+)$`)

113 if err != nil {

114 pipe <- err

docker_cli_history_test.go (https://gitlab.com/liwh/docker) Go · 126 lines

3 import (

4 "fmt"

5 "regexp"

6 "strconv"

7 "strings"

93 out, _ := dockerCmd(c, "history", "--human=false", "busybox")

94 lines := strings.Split(out, "\n")

95 sizeColumnRegex, _ := regexp.Compile("SIZE +")

96 indices := sizeColumnRegex.FindStringIndex(lines[0])

112 out, _ := dockerCmd(c, "history", "--human=true", "busybox")

113 lines := strings.Split(out, "\n")

114 sizeColumnRegex, _ := regexp.Compile("SIZE +")

115 humanSizeRegexRaw := "\\d+.*B" // Matches human sizes like 10 MB, 3.2 KB, etc

122 }

123 sizeString := lines[i][startIndex:endIndex]

124 c.Assert(strings.TrimSpace(sizeString), checker.Matches, humanSizeRegexRaw, check.Commentf("The size '%s' was not in human format", sizeString))

125 }

126 }

apply.go (https://gitlab.com/admin-github-cloud/hub) Go · 113 lines

4 "io"

5 "io/ioutil"

6 "regexp"

7

8 "github.com/github/hub/github"

67

68 func transformApplyArgs(args *Args) {

69 gistRegexp := regexp.MustCompile("^https?://gist\\.github\\.com/([\\w.-]+/)?([a-f0-9]+)")

70 pullRegexp := regexp.MustCompile("^(pull|commit)/([0-9a-f]+)")

77 if err == nil {

78 gh := github.NewClient(projectURL.Project.Host)

79 match := pullRegexp.FindStringSubmatch(projectURL.ProjectPath())

80 if match != nil {

81 if match[1] == "pull" {

86 }

87 } else {

88 match := gistRegexp.FindStringSubmatch(arg)

89 if match != nil {

90 // TODO: support Enterprise gist

ast.go (https://gitlab.com/CORP-RESELLER/kubernetes) Go · 1743 lines

5 "errors"

6 "fmt"

7 "regexp"

8 "sort"

9 "strconv"

125 func (*NumberLiteral) node() {}

126 func (*ParenExpr) node() {}

127 func (*RegexLiteral) node() {}

128 func (*SortField) node() {}

129 func (SortFields) node() {}

755 RetentionPolicy: s.Target.Measurement.RetentionPolicy,

756 Name: s.Target.Measurement.Name,

757 Regex: CloneRegexLiteral(s.Target.Measurement.Regex),

758 },

759 }

789 if s.Regex != nil {

790 m.Regex = &RegexLiteral{Val: regexp.MustCompile(s.Regex.Val.String())}

791 }

792 return m

xml.go (https://gitlab.com/CORP-RESELLER/dashboard) Go · 1417 lines

134 PostalCodeData *struct {

135 Common

136 PostCodeRegex []*struct {

137 Common

138 TerritoryId string `xml:"territoryId,attr"`

139 } `xml:"postCodeRegex"`

140 } `xml:"postalCodeData"`

141 CalendarData *struct {

properties.go (https://gitlab.com/paul22/kanban) Go · 746 lines

13 "log"

14 "os"

15 "regexp"

16 "strconv"

17 "strings"

48 Postfix string

49

50 // DisableExpansion controls the expansion of properties on Get()

51 // and the check for circular references on Set(). When set to

52 // true Properties behaves like a simple key/value store and does

437 // FilterRegexp returns a new properties object which contains all properties

438 // for which the key matches the regular expression.

439 func (p *Properties) FilterRegexp(re *regexp.Regexp) *Properties {

440 pp := NewProperties()

441 for _, k := range p.k {

route.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 583 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

25 _ = fmt.Print

26 _ = utf8.UTFMax

27 _ = (*regexp.Regexp)(nil)

28 _ = (*strings.Reader)(nil)

29 _ = net.IPv4len

34 )

35

36 // define the regex for a UUID once up-front

37 var _route_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

qdeclarativejsparser.cpp (https://bitbucket.org/ultra_iter/qt-vtl.git) C++ · 1904 lines

606

607 case 78: {

608 bool rx = lexer->scanRegExp(Lexer::NoPrefix);

609 if (!rx) {

610 diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));

614 loc(1).length = lexer->tokenLength();

615

616 AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);

617 node->literalToken = loc(1);

618 sym(1).Node = node;

628 loc(1).length = lexer->tokenLength();

629

630 AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);

631 node->literalToken = loc(1);

632 sym(1).Node = node;

util.go (https://gitlab.com/kumarsiva07/revel) Go · 172 lines

8 "os"

9 "reflect"

10 "regexp"

11 "strings"

12 )

65

66 var (

67 cookieKeyValueParser = regexp.MustCompile("\x00([^:]*):([^\x00]*)\x00")

68 )

69

config.go (https://gitlab.com/CORP-RESELLER/dashboard) Go · 180 lines

26 RandomSeed int64

27 RandomizeAllSpecs bool

28 RegexScansFilePath bool

29 FocusString string

30 SkipString string

74 flagSet.StringVar(&(GinkgoConfig.SkipString), prefix+"skip", "", "If set, ginkgo will only run specs that do not match this regular expression.")

75

76 flagSet.BoolVar(&(GinkgoConfig.RegexScansFilePath), prefix+"regexScansFilePath", false, "If set, ginkgo regex matching also will look at the file path (code location).")

77

78 flagSet.BoolVar(&(GinkgoConfig.EmitSpecProgress), prefix+"progress", false, "If set, ginkgo will emit progress information as each spec runs to the GinkgoWriter.")

149 }

150

151 if ginkgo.RegexScansFilePath {

152 result = append(result, fmt.Sprintf("--%sregexScansFilePath", prefix))

autohotkey.vim (https://bitbucket.org/ultra_iter/vim-qt.git) Vim Script · 292 lines

166

167 syn keyword autohotkeyFunction

168 \ InStr RegExMatch RegExReplace StrLen SubStr Asc Chr

169 \ DllCall VarSetCapacity WinActive WinExist IsLabel OnMessage

170 \ Abs Ceil Exp Floor Log Ln Mod Round Sqrt Sin Cos Tan ASin ACos ATan

header_to_metadata.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 333 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

25 _ = fmt.Print

26 _ = utf8.UTFMax

27 _ = (*regexp.Regexp)(nil)

28 _ = (*strings.Reader)(nil)

29 _ = net.IPv4len

34 )

35

36 // define the regex for a UUID once up-front

37 var _header_to_metadata_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

157 // no validation rules for Value

158

159 case *Config_KeyValuePair_RegexValueRewrite:

160

161 if v, ok := interface{}(m.GetRegexValueRewrite()).(interface{ Validate() error }); ok {

header_to_metadata.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 326 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

25 _ = fmt.Print

26 _ = utf8.UTFMax

27 _ = (*regexp.Regexp)(nil)

28 _ = (*strings.Reader)(nil)

29 _ = net.IPv4len

34 )

35

36 // define the regex for a UUID once up-front

37 var _header_to_metadata_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

150 // no validation rules for Value

151

152 if v, ok := interface{}(m.GetRegexValueRewrite()).(interface{ Validate() error }); ok {

153 if err := v.Validate(); err != nil {

154 return Config_KeyValuePairValidationError{

config.go (https://github.com/rudderlabs/rudder-server.git) Go · 206 lines

26 RandomSeed int64

27 RandomizeAllSpecs bool

28 RegexScansFilePath bool

29 FocusString string

30 SkipString string

78 flagSet.StringVar(&(GinkgoConfig.SkipString), prefix+"skip", "", "If set, ginkgo will only run specs that do not match this regular expression.")

79

80 flagSet.BoolVar(&(GinkgoConfig.RegexScansFilePath), prefix+"regexScansFilePath", false, "If set, ginkgo regex matching also will look at the file path (code location).")

81

82 flagSet.IntVar(&(GinkgoConfig.FlakeAttempts), prefix+"flakeAttempts", 1, "Make up to this many attempts to run each spec. Please note that if any of the attempts succeed, the suite will not be failed. But any failures will still be recorded.")

167 }

168

169 if ginkgo.RegexScansFilePath {

170 result = append(result, fmt.Sprintf("--%sregexScansFilePath", prefix))

resource_aws_media_convert_queue_test.go (https://github.com/terraform-providers/terraform-provider-aws.git) Go · 350 lines

3 import (

4 "fmt"

5 "regexp"

6 "testing"

7

28 Check: resource.ComposeTestCheckFunc(

29 testAccCheckAwsMediaConvertQueueExists(resourceName, &queue),

30 testAccMatchResourceAttrRegionalARN(resourceName, "arn", "mediaconvert", regexp.MustCompile(`queues/.+`)),

31 resource.TestCheckResourceAttr(resourceName, "name", rName),

32 resource.TestCheckResourceAttr(resourceName, "pricing_plan", mediaconvert.PricingPlanOnDemand),

eval_validate.go (https://github.com/alibaba/terraform-provider.git) Go · 228 lines

212 // If the resource name doesn't match the name regular

213 // expression, show an error.

214 if !config.NameRegexp.Match([]byte(n.ResourceName)) {

215 errs = append(errs, fmt.Errorf(

216 "%s: resource name can only contain letters, numbers, "+

resource_aws_iam_policy.go (https://github.com/alibaba/terraform-provider.git) Go · 296 lines

4 "fmt"

5 "net/url"

6 "regexp"

7

8 "github.com/aws/aws-sdk-go/aws"

55 "%q cannot be longer than 128 characters", k))

56 }

57 if !regexp.MustCompile("^[\\w+=,.@-]*$").MatchString(value) {

58 errors = append(errors, fmt.Errorf(

59 "%q must match [\\w+=,.@-]", k))

73 "%q cannot be longer than 96 characters, name is limited to 128", k))

74 }

75 if !regexp.MustCompile("^[\\w+=,.@-]*$").MatchString(value) {

76 errors = append(errors, fmt.Errorf(

77 "%q must match [\\w+=,.@-]", k))

path_config.go (https://github.com/hashicorp/vault.git) Go · 212 lines

1 package transit

2

3 import (

12 func (b *backend) pathConfig() *framework.Path {

13 return &framework.Path{

14 Pattern: "keys/" + framework.GenericNameRegex("name") + "/config",

15 Fields: map[string]*framework.FieldSchema{

16 "name": &framework.FieldSchema{

110 if minDecryptionVersion == 0 {

111 minDecryptionVersion = 1

112 resp.AddWarning("since Vault 0.3, transit key numbering starts at 1; forcing minimum to 1")

113 }

114

router_test.go (https://github.com/coreroller/coreroller.git) Go · 326 lines

5 "net/http/httptest"

6 "reflect"

7 "regexp"

8 "testing"

9 "time"

72 m.Get("/hello/carl", http.NotFound)

73 m.Get("/hello/:name", http.NotFound)

74 m.Get(regexp.MustCompile(`^/hello/(?P<name>.+)$`), http.NotFound)

75 m.Get(testPattern{}, http.NotFound)

76 }

attribute_context.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 406 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

25 _ = fmt.Print

26 _ = utf8.UTFMax

27 _ = (*regexp.Regexp)(nil)

28 _ = (*strings.Reader)(nil)

29 _ = net.IPv4len

34 )

35

36 // define the regex for a UUID once up-front

37 var _attribute_context_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

types.go (https://github.com/yunionio/onecloud.git) Go · 487 lines

62 XMLName xml.Name

63

64 Regexp string `xml:"regexp,attr"`

65 Scope string `xml:",innerxml"`

66 }

curly.go (https://gitlab.com/github-cloud-corporation/kubernetes) Go · 162 lines

7 import (

8 "net/http"

9 "regexp"

10 "sort"

11 "strings"

76 paramCount++

77 if colon := strings.Index(routeToken, ":"); colon != -1 {

78 // match by regex

79 matchesToken, matchesRemainder := c.regularMatchesPathToken(routeToken, colon, requestToken)

80 if !matchesToken {

105 return true, true

106 }

107 matched, err := regexp.MatchString(regPart, requestToken)

108 return (matched && err == nil), false

109 }

rbac.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 130 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

25 _ = fmt.Print

26 _ = utf8.UTFMax

27 _ = (*regexp.Regexp)(nil)

28 _ = (*strings.Reader)(nil)

29 _ = net.IPv4len

34 )

35

36 // define the regex for a UUID once up-front

37 var _rbac_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

qdeclarativejsastfwd_p.h (https://bitbucket.org/ultra_iter/qt-vtl.git) C Header · 189 lines

94 class NumericLiteral;

95 class StringLiteral;

96 class RegExpLiteral;

97 class ArrayLiteral;

98 class ObjectLiteral;

match.go (https://github.com/constabulary/gb.git) Go · 145 lines

6 "path"

7 "path/filepath"

8 "regexp"

9 "strings"

10 )

11

12 // importPathsNoDotExpansion returns the import paths to use for the given

13 // command line, but it does no ... expansion.

14 func importPathsNoDotExpansion(srcdir string, cwd string, args []string) []string {

15 srcdir, _ = filepath.Rel(srcdir, cwd)

16 if srcdir == ".." {

36 // ImportPaths returns the import paths to use for the given command line.

37 func ImportPaths(srcdir, cwd string, args []string) []string {

38 args = importPathsNoDotExpansion(srcdir, cwd, args)

39 var out []string

40 for _, a := range args {

generate.go (https://github.com/GoogleContainerTools/skaffold.git) Go · 71 lines

19 import (

20 "fmt"

21 "regexp"

22

23 utilrand "k8s.io/apimachinery/pkg/util/rand"

63 base = base[:maxNameLength]

64 }

65 var isAlphaNumeric = regexp.MustCompile(`^[a-zA-Z0-9]+$`).MatchString

66

67 for !isAlphaNumeric(base[len(base)-1:]) {

ansi.go (https://gitlab.com/djui/pkg) Go · 354 lines

1 package ansi

2

3 import (

4 "bytes"

5 "fmt"

6 "regexp"

7 "strconv"

8 "strings"

258 }

259

260 // RemoveEscapeSequences removes ANSI escape sequences.

261 func RemoveEscapeSequences() {

262 // TODO(uwe): Implement

267 }

268

269 // Colors defines the standard HTML colours for ANSI.

270 var Colors = []string{

271 "#000000", "#Dd0000", "#00CF12", "#C2CB00", "#3100CA", "#E100C6", "#00CBCB", "#C7C7C7",

evaluationFailure_test.go (https://github.com/kevin-hf/education.git) Go · 484 lines

32 INVALID_TERNARY_TYPES = "cannot be used with the ternary operator"

33 ABSENT_PARAMETER = "No parameter"

34 INVALID_REGEX = "Unable to compile regexp pattern"

35 )

36

246

247 /*

248 While there is type-safe transitions checked at parse-time, tested in the "parsing_test" and "parsingFailure_test" files,

249 we also need to make sure that we receive type mismatch errors during evaluation.

250 */

392 }

393

394 func TestRegexParameterCompilation(test *testing.T) {

395

396 evaluationTests := []EvaluationFailureTest{

mprof_test.go (https://gitlab.com/adotout/gcc) Go · 179 lines

12 "internal/profile"

13 "reflect"

14 "regexp"

15 "runtime"

16 "testing"

20 var memSink any

21

22 func allocateTransient1M() {

23 for i := 0; i < 1024; i++ {

24 memSink = &struct{ x [1024]byte }{}

27

28 //go:noinline

29 func allocateTransient2M() {

30 memSink = make([]byte, 2<<20)

31 }

ingress.go (https://gitlab.com/wilane/traefik) Go · 151 lines

125 }

126

127 // HTTPIngressPath associates a path regex with a backend. Incoming urls matching

128 // the path are forwarded to the backend.

129 type HTTPIngressPath struct {

130 // Path is a extended POSIX regex as defined by IEEE Std 1003.1,

131 // (i.e this follows the egrep/unix syntax, not the perl syntax)

132 // matched against the path of an incoming request. Currently it can

suite.go (https://github.com/hyperledger/fabric.git) Go · 190 lines

75

76 specs := spec.NewSpecs(specsSlice)

77 specs.RegexScansFilePath = config.RegexScansFilePath

78

79 if config.RandomizeAllSpecs {

search_repositories_test.go (https://github.com/sourcegraph/sourcegraph.git) Go · 223 lines

147 }, &searchResultsCommon{}, nil

148 }

149 pat := &search.TextPatternInfo{Pattern: "", FilePatternsReposMustInclude: []string{"foo"}, IsRegExp: true, FileMatchLimit: 1, PathPatternsAreCaseSensitive: false, PatternMatchesContent: true, PatternMatchesPath: true}

150 shouldBeAdded, err := repoShouldBeAdded(context.Background(), zoekt, repo, pat)

151 if err != nil {

162 return []*FileMatchResolver{}, &searchResultsCommon{}, nil

163 }

164 pat := &search.TextPatternInfo{Pattern: "", FilePatternsReposMustInclude: []string{"foo"}, IsRegExp: true, FileMatchLimit: 1, PathPatternsAreCaseSensitive: false, PatternMatchesContent: true, PatternMatchesPath: true}

165 shouldBeAdded, err := repoShouldBeAdded(context.Background(), zoekt, repo, pat)

166 if err != nil {

182 }, &searchResultsCommon{}, nil

183 }

184 pat := &search.TextPatternInfo{Pattern: "", FilePatternsReposMustExclude: []string{"foo"}, IsRegExp: true, FileMatchLimit: 1, PathPatternsAreCaseSensitive: false, PatternMatchesContent: true, PatternMatchesPath: true}

185 shouldBeAdded, err := repoShouldBeAdded(context.Background(), zoekt, repo, pat)

186 if err != nil {

dns_cache.pb.validate.go (https://github.com/envoyproxy/go-control-plane.git) Go · 272 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

27 _ = fmt.Print

28 _ = utf8.UTFMax

29 _ = (*regexp.Regexp)(nil)

30 _ = (*strings.Reader)(nil)

31 _ = net.IPv4len

38 )

39

40 // define the regex for a UUID once up-front

41 var _dns_cache_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

sqlmock.go (https://gitlab.com/sheket/server) Go · 454 lines

40

41 // ExpectQuery expects Query() or QueryRow() to be called with sql query

42 // which match sqlRegexStr given regexp.

43 // the *ExpectedQuery allows to mock database response.

44 ExpectQuery(sqlRegexStr string) *ExpectedQuery

256 func (c *sqlmock) ExpectExec(sqlRegexStr string) *ExpectedExec {

257 e := &ExpectedExec{}

258 e.sqlRegex = regexp.MustCompile(sqlRegexStr)

259 c.expected = append(c.expected, e)

260 return e

300 func (c *sqlmock) ExpectPrepare(sqlRegexStr string) *ExpectedPrepare {

301 e := &ExpectedPrepare{sqlRegex: regexp.MustCompile(sqlRegexStr), mock: c}

302 c.expected = append(c.expected, e)

303 return e

367 func (c *sqlmock) ExpectQuery(sqlRegexStr string) *ExpectedQuery {

368 e := &ExpectedQuery{}

369 e.sqlRegex = regexp.MustCompile(sqlRegexStr)

370 c.expected = append(c.expected, e)

371 return e

terraform_naming_convention.go (https://github.com/wata727/tflint.git) Go · 232 lines

30 // CustomFormatConfig defines a custom format that can be used instead of the predefined formats

31 type CustomFormatConfig struct {

32 Regexp string `cty:"regex"`

33 Description string `cty:"description"`

34 }

44 Format string

45 IsNamedFormat bool

46 Regexp *regexp.Regexp

47 }

48

212 IsNamedFormat: true,

213 Format: format,

214 Regexp: regex,

215 }

216 return nameValidator, nil

watch_test.go (https://github.com/Tencent/bk-cmdb.git) Go · 275 lines

228

229 Describe("modifying the regular expression", func() {

230 It("should trigger if the regexp matches", func() {

231 session = startGinkgoWithGopath("watch", "-succinct", "-r", "-depth=2", `-watchRegExp=\.json$`)

strings.go (https://github.com/terraform-providers/terraform-provider-azurerm.git) Go · 253 lines

89 // return something friendlier than "must match some globby regexp".

90 func StringMatch(r *regexp.Regexp, message string) schema.SchemaValidateFunc {

91 return func(i interface{}, k string) ([]string, []error) {

92 v, ok := i.(string)

107

108 // StringDoesNotMatch returns a SchemaValidateFunc which tests if the provided value

109 // does not match a given regexp. Optionally an error message can be provided to

110 // return something friendlier than "must not match some globby regexp".

111 func StringDoesNotMatch(r *regexp.Regexp, message string) schema.SchemaValidateFunc {

112 return func(i interface{}, k string) ([]string, []error) {

113 v, ok := i.(string)

240 // StringIsValidRegExp returns a SchemaValidateFunc which tests to make sure the supplied string is a valid regular expression.

241 func StringIsValidRegExp(i interface{}, k string) (warnings []string, errors []error) {

242 v, ok := i.(string)

243 if !ok {

static_file_server.go (https://github.com/blend/go-sdk.git) Go · 258 lines

13 "net/http"

14 "os"

15 "regexp"

16 "sync"

17

80 // Typically re-write rules are used to enforce caching semantics.

81 func (sc *StaticFileServer) AddRewriteRule(match string, action RewriteAction) error {

82 expr, err := regexp.Compile(match)

83 if err != nil {

84 return err

193 sc.RUnlock()

194

195 // transition to exclusive write mode

196 sc.Lock()

197 defer sc.Unlock()

range.go (https://github.com/tricksterproxy/trickster.git) Go · 315 lines

22 "errors"

23 "fmt"

24 "regexp"

25 "sort"

26 "strconv"

45 const byteResponsRangePrefix = "bytes "

46

47 var respRE *regexp.Regexp

48

49 func init() {

50 respRE = regexp.MustCompile(`^bytes ([0-9]+)-([0-9]+)\/([0-9]+)$`)

51 }

52

permalinks.go (https://gitlab.com/Slind/hugo) Go · 189 lines

4 "errors"

5 "fmt"

6 "regexp"

7 "strconv"

8 "strings"

26 var knownPermalinkAttributes map[string]PageToPermaAttribute

27

28 var attributeRegexp *regexp.Regexp

29

30 // validate determines if a PathPattern is well-formed

186 }

187

188 attributeRegexp = regexp.MustCompile(":\\w+")

189 }

190

headerparser.go (https://gitlab.com/unofficial-mirrors/openshift-source-to-image) Go · 161 lines

3 import (

4 "fmt"

5 "regexp"

6 "strings"

7 "unicode"

10 var (

11 // according to rfc7230

12 reToken = regexp.MustCompile(`^[^"(),/:;<=>?@[\]{}[:space:][:cntrl:]]+`)

13 reQuotedValue = regexp.MustCompile(`^[^\\"]+`)

14 reEscapedCharacter = regexp.MustCompile(`^[[:blank:][:graph:]]`)

15 )

16

28 // {"for": "192.0.2.43:443", "host": "registry.example.org"}.

29 func parseForwardedHeader(forwarded string) (map[string]string, string, error) {

30 // Following are states of forwarded header parser. Any state could transition to a failure.

31 const (

32 // terminating state; can transition to Parameter

config.go (https://github.com/zricethezav/gitleaks.git) Go · 249 lines

17 type AllowList struct {

18 Description string

19 Regexes []*regexp.Regexp

20 Commits []string

21 Files []*regexp.Regexp

22 Paths []*regexp.Regexp

23 Repos []*regexp.Regexp

38 type Rule struct {

39 Description string

40 Regex *regexp.Regexp

41 File *regexp.Regexp

144 return cfg, fmt.Errorf("problem loading config: %v", err)

145 }

146 allowList.Regexes = append(allowList.Regexes, allowListedRegex)

147 }

148

nodes.go (https://gitlab.com/vafl/vafl) Go · 281 lines

1 package parser

2

3 import "regexp"

4 import "strings"

5

21 "default": `<!DOCTYPE html>`,

22 "xml": `<?xml version="1.0" encoding="utf-8" ?>`,

23 "transitional": `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">`,

24 "strict": `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">`,

25 "frameset": `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">`,

238 mixin.Name = name

239

240 delExp := regexp.MustCompile(`,\s`)

241 mixin.Args = delExp.Split(args, -1)

242

migrate.go (https://gitlab.com/jamesclonk-io/moviedb-backend) Go · 317 lines

213 return nil, err

214 }

215 files, err := file.ReadMigrationFiles(migrationsPath, file.FilenameRegex(d.FilenameExtension()))

216 if err != nil {

217 return nil, err

269 return nil, nil, 0, err

270 }

271 files, err := file.ReadMigrationFiles(migrationsPath, file.FilenameRegex(d.FilenameExtension()))

272 if err != nil {

273 d.Close() // TODO what happens with errors from this func?

tests_suite.go (https://github.com/rexray/rexray.git) Go · 316 lines

215 // MatchRegexp is part of the Ginkgo DSL

216 var MatchRegexp = gomega.MatchRegexp

217

218 // ContainSubstring is part of the Ginkgo DSL

generate.go (https://github.com/tektoncd/pipeline.git) Go · 72 lines

19 import (

20 "fmt"

21 "regexp"

22

23 utilrand "k8s.io/apimachinery/pkg/util/rand"

59 }

60

61 var alphaNumericRE = regexp.MustCompile(`^[a-zA-Z0-9]+$`)

62

63 func (simpleNameGenerator) RestrictLength(base string) string {

versions_test.go (https://gitlab.com/JamesClonk/s3-resource) Go · 156 lines

13 Context("when given an empty list of paths", func() {

14 It("returns an empty list of matches", func() {

15 result, err := versions.Match([]string{}, "regex")

16

17 Ω(err).ShouldNot(HaveOccurred())

21

22 Context("when given a single path", func() {

23 It("returns it in a singleton list if it matches the regex", func() {

24 paths := []string{"abc"}

25 regex := "abc"

26

27 result, err := versions.Match(paths, regex)

28 Ω(err).ShouldNot(HaveOccurred())

29 Ω(result).Should(ConsistOf("abc"))

simple.go (https://code.google.com/p/sre2/) Go · 143 lines ✨ Summary

This Go code implements a regular expression (regex) engine, allowing users to match strings against predefined patterns. It uses a finite state machine approach to efficiently search for matches in input strings, capturing groups and returning success indicators. The code is designed to be efficient and scalable, using techniques like sparse bitsets and linked lists to minimize memory usage.

1 package sre2

2

3 func (r *sregexp) Match(src string) bool {

4 success, _ := r.run(src, false)

5 return success

6 }

7

8 func (r *sregexp) MatchIndex(src string) []int {

9 _, capture := r.run(src, true)

10 return capture

11 }

12

13 func (r *sregexp) run(src string, submatch bool) (success bool, capture []int) {

14 curr := makeStateList(len(r.prog))

15 next := makeStateList(len(r.prog))

mouse-speak.min.js (https://github.com/apalsapure/pubnub-api.git) JavaScript · 12 lines

4 0)-c>100)e.last=c;if(!(!j&&c&&e.last&&e.last>c)){if(c)e.last=c;if(f)e.node.innerHTML=f.replace(O,"");e.timerfade&&clearTimeout(e.timerfade);e.timerfade=setTimeout(function(){PUBNUB.css(e.node,{opacity:0.4});clearTimeout(e.timerfade);e.timerfade=setTimeout(function(){PUBNUB.css(e.node,{display:"none"})},G)},G);PUBNUB.css(e.node,{display:"block",opacity:1});if(b){g.move(e,{top:b[1],left:b[0]},m-10);if(b[0]>e.left)g.setframe(e,0,{top:36});else b[0]<e.left&&g.setframe(e,0,{top:1})}}}function N(a){var b=

5 PUBNUB.create("div");if(!(a[1]&&a[0]))return 1;PUBNUB.css(b,{position:"absolute",background:"transparent url(http://www.pubnub.com/static/mouse-click.png) no-repeat",top:a[1],left:a[0],width:13,height:13});n.appendChild(b);return 1}function P(a,b){setTimeout(function(){if(",13,27,".indexOf(","+b+",")!==-1)k.value=" ";l(a)},20);return 1}function Q(){return x=1}function y(a){x=0;a=A(a);var b={pos:a,click:1,uuid:i};if(a[1]&&a[0]){PUBNUB.publish({channel:w,message:b});b.force=1;s(b)}return 1}function L(){var a=

6 k.value||"",b=a.length;if(b>H)k.value=a="..."+a.slice(-H);else if(a.indexOf(t)!=-1&&b>t.length)k.value=a=a.replace(t,"");return a}var u=this.localStorage,r={get:function(a){if(u)return u.getItem(a);if(document.cookie.indexOf(a)==-1)return null;return((document.cookie||"").match(RegExp(a+"=([^;]+)"))||[])[1]||null},set:function(a,b){if(u)return u.setItem(a,b);document.cookie=a+"="+b+"; expires=Thu, 1 Aug 2030 20:00:00 UTC; path=/"}},h=PUBNUB.bind,n=PUBNUB.search("body")[0],B=document.documentElement,

7 p={},w="mouse-speak",G=9E3,k=PUBNUB.create("input"),x=0,q=[],F="",M=0,i=r.get("uuid")||0,m=100,H=34,o=10,D=0,C=0,O=/[<>]/g,g={create:function(a){a.intervals={animate:0,move:{}};a.cell.size=Math.floor(a.image.width/a.cell.count);a.node=PUBNUB.create("div");a.opacity=a.opacity||1;PUBNUB.css(a.node,{opacity:a.opacity,position:"absolute",top:a.top,left:a.left,width:a.cell.size,height:a.image.height,backgroundRepeat:"no-repeat",backgroundImage:"url("+a.image.url+")"});g.setframe(a,0);g.append(a.node);

8 return a},ground:PUBNUB.search("body")[0],append:function(a){g.ground.appendChild(a)},setframe:function(a,b,d){d=d||{};if(typeof d.top=="number")a.image.offset.top=d.top;if(typeof d.left=="number")a.image.offset.left=d.left;PUBNUB.css(a.node,{backgroundPosition:"-"+(a.cell.size*b+a.image.offset.left)+"px -"+a.image.offset.top+"px"})},animate:function(a,b,d,f,c){if(!c){c=0;g.stop_animate(a)}if(c===b.length)if(d===0)return f&&f();else{d--;c=0}var j=b[c][0]||b[c];a.intervals.animate=setTimeout(function(){g.setframe(a,

controller_test.go (https://github.com/kubernetes/test-infra.git) Go · 1158 lines

176 JobBase: config.JobBase{Name: "old-job"},

177 Reporter: config.Reporter{Context: "old-context"},

178 RegexpChangeMatcher: config.RegexpChangeMatcher{RunIfChanged: "new-changes"},

179 }},

180 },

211 JobBase: config.JobBase{Name: "old-job"},

212 Reporter: config.Reporter{Context: "old-context"},

213 RegexpChangeMatcher: config.RegexpChangeMatcher{RunIfChanged: "changes"},

214 }},

215 },

340 },

341 {

342 name: "required presubmit transitioning to new context means no removed blocking jobs",

343 old: `"org/repo":

344 - name: old-job

tls.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 684 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

25 _ = fmt.Print

26 _ = utf8.UTFMax

27 _ = (*regexp.Regexp)(nil)

28 _ = (*strings.Reader)(nil)

29 _ = net.IPv4len

34 )

35

36 // define the regex for a UUID once up-front

37 var _tls_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

common.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 593 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

25 _ = fmt.Print

26 _ = utf8.UTFMax

27 _ = (*regexp.Regexp)(nil)

28 _ = (*strings.Reader)(nil)

29 _ = net.IPv4len

34 )

35

36 // define the regex for a UUID once up-front

37 var _common_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

tcp_proxy.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 694 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

25 _ = fmt.Print

26 _ = utf8.UTFMax

27 _ = (*regexp.Regexp)(nil)

28 _ = (*strings.Reader)(nil)

29 _ = net.IPv4len

34 )

35

36 // define the regex for a UUID once up-front

37 var _tcp_proxy_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

config.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 1015 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

25 _ = fmt.Print

26 _ = utf8.UTFMax

27 _ = (*regexp.Regexp)(nil)

28 _ = (*strings.Reader)(nil)

29 _ = net.IPv4len

34 )

35

36 // define the regex for a UUID once up-front

37 var _config_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

72 return JwtProviderValidationError{

73 field: "ForwardPayloadHeader",

74 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",

75 }

76 }

redis_proxy.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 621 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

25 _ = fmt.Print

26 _ = utf8.UTFMax

27 _ = (*regexp.Regexp)(nil)

28 _ = (*strings.Reader)(nil)

29 _ = net.IPv4len

34 )

35

36 // define the regex for a UUID once up-front

37 var _redis_proxy_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

protocol.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 907 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

25 _ = fmt.Print

26 _ = utf8.UTFMax

27 _ = (*regexp.Regexp)(nil)

28 _ = (*strings.Reader)(nil)

29 _ = net.IPv4len

34 )

35

36 // define the regex for a UUID once up-front

37 var _protocol_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

base.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 1642 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

25 _ = fmt.Print

26 _ = utf8.UTFMax

27 _ = (*regexp.Regexp)(nil)

28 _ = (*strings.Reader)(nil)

29 _ = net.IPv4len

34 )

35

36 // define the regex for a UUID once up-front

37 var _base_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

753 return HeaderValueValidationError{

754 field: "Key",

755 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",

756 }

757 }

bootstrap.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 1368 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

25 _ = fmt.Print

26 _ = utf8.UTFMax

27 _ = (*regexp.Regexp)(nil)

28 _ = (*strings.Reader)(nil)

29 _ = net.IPv4len

34 )

35

36 // define the regex for a UUID once up-front

37 var _bootstrap_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

accesslog.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 1317 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

25 _ = fmt.Print

26 _ = utf8.UTFMax

27 _ = (*regexp.Regexp)(nil)

28 _ = (*strings.Reader)(nil)

29 _ = net.IPv4len

34 )

35

36 // define the regex for a UUID once up-front

37 var _accesslog_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

listener_components.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 742 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

25 _ = fmt.Print

26 _ = utf8.UTFMax

27 _ = (*regexp.Regexp)(nil)

28 _ = (*strings.Reader)(nil)

29 _ = net.IPv4len

34 )

35

36 // define the regex for a UUID once up-front

37 var _listener_components_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

segment_mock.go (https://github.com/m3db/m3.git) Go · 1788 lines

229 // MatchRegexp mocks base method

230 func (m *MockReader) MatchRegexp(field []byte, c index.CompiledRegex) (postings.List, error) {

231 m.ctrl.T.Helper()

232 ret := m.ctrl.Call(m, "MatchRegexp", field, c)

236 }

237

238 // MatchRegexp indicates an expected call of MatchRegexp

239 func (mr *MockReaderMockRecorder) MatchRegexp(field, c interface{}) *gomock.Call {

240 mr.mock.ctrl.T.Helper()

241 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MatchRegexp", reflect.TypeOf((*MockReader)(nil).MatchRegexp), field, c)

242 }

243

buffer.go (https://gitlab.com/vectorci/kubernetes) Go · 229 lines

16 "fmt"

17 "io"

18 "regexp"

19 "sync"

20 "time"

158 formattedRegexp = fmt.Sprintf(desired, args...)

159 }

160 re := regexp.MustCompile(formattedRegexp)

161

162 b.lock.Lock()

211 }

212

213 func (b *Buffer) didSay(re *regexp.Regexp) (bool, []byte) {

214 b.lock.Lock()

215 defer b.lock.Unlock()

config.go (https://gitlab.com/github-cloud-corporation/coreos-baremetal) Go · 154 lines

18 "fmt"

19 "reflect"

20 "regexp"

21 "strings"

22 "unicode"

125

126 vs := fmt.Sprintf("%v", value.Interface())

127 if m, _ := regexp.MatchString(valid, vs); m {

128 return nil

129 }

comparison.go (https://github.com/campoy/justforfunc.git) Go · 613 lines

176 }

177

178 // Regexp is a comparison that checks an expression matches a regexp.

179 type Regexp struct {

184 // NewRegexp creates a new Regexp expression.

185 func NewRegexp(left sql.Expression, right sql.Expression) *Regexp {

186 return &Regexp{newComparison(left, right), nil}

205 }

206

207 func (re *Regexp) compareRegexp(ctx *sql.Context, row sql.Row) (interface{}, error) {

208 left, right, err := re.evalLeftAndRight(ctx, row)

209 if err != nil {

226

227 if re.r == nil {

228 re.r, err = regex.New(regex.Default(), right.(string))

229 if err != nil {

230 return false, err

getters.go (https://github.com/coreos/coreos-assembler.git) Go · 283 lines

69

70 // getComments extracts comments from a file.

71 func (pf *parsedFile) getComments(scope Scope, exclude []*regexp.Regexp) []comment {

72 var comments []comment

73 decl := pf.getDeclarationComments(exclude)

97 // getBlockComments gets comments from the inside of top level blocks:

98 // var (...), const (...).

99 func (pf *parsedFile) getBlockComments(exclude []*regexp.Regexp) []comment {

100 var comments []comment

101 for _, decl := range pf.file.Decls {

136

137 // getTopLevelComments gets all top level comments.

138 func (pf *parsedFile) getTopLevelComments(exclude []*regexp.Regexp) []comment {

139 var comments []comment // nolint: prealloc

140 for _, c := range pf.file.Comments {

funcs_ast_validator.go (https://github.com/emqx/kuiper.git) Go · 421 lines

101 }

102 }

103 case "endswith", "indexof", "regexp_matches", "startswith":

104 if err := validateLen(name, 2, len); err != nil {

105 return err

122 }

123

124 case "regexp_replace":

125 if err := validateLen(name, 3, len); err != nil {

126 return err

cgo_test.go (https://github.com/tinygo-org/tinygo.git) Go · 145 lines

12 "io/ioutil"

13 "path/filepath"

14 "regexp"

15 "runtime"

16 "strings"

30 // such functions are wrapped and it's important to have consistent test

31 // results.

32 re := regexp.MustCompile(`func \((.+)\)( .*?) +{ (.+) }`)

33 actual = re.ReplaceAllString(actual, "func ($1)$2 {\n\t$3\n}")

34

service_access_test.go (https://gitlab.com/JamesClonk/cli) Go · 219 lines

213 runCommand()

214

215 Expect(strings.Join(ui.Outputs, "\n")).To(MatchRegexp(`FAILED\nError finding service brokers`))

216 })

217 })

package_reference.go (https://github.com/fossas/fossa-cli.git) Go · 130 lines

3 import (

4 "path/filepath"

5 "regexp"

6

7 "github.com/fossas/fossa-cli/files"

67 // IsPackageReferenceFile checks for a valid package reference file name.

68 func IsPackageReferenceFile(filename string) bool {

69 var xmlProj = regexp.MustCompile(`\.(cs|x|vb|db|fs)proj$`)

70 return xmlProj.MatchString(filename)

71 }

101 return graph.Deps{

102 Direct: imports,

103 Transitive: dependencyMap,

104 }, nil

105 }

builder_test.go (https://github.com/github/gh-ost.git) Go · 679 lines

10

11 "reflect"

12 "regexp"

13 "strings"

14

18

19 var (

20 spacesRegexp = regexp.MustCompile(`[ \t\n\r]+`)

21 )

22

27 func normalizeQuery(name string) string {

28 name = strings.Replace(name, "`", "", -1)

29 name = spacesRegexp.ReplaceAllString(name, " ")

30 name = strings.TrimSpace(name)

31 return name

query.go (https://github.com/mattermost/platform.git) Go · 218 lines

174 }

175

176 // NewRegexpQuery creates a new Query which finds

177 // documents containing terms that match the

178 // specified regular expression.

179 func NewRegexpQuery(regexp string) *query.RegexpQuery {

180 return query.NewRegexpQuery(regexp)

api.go (https://github.com/jpmorganchase/quorum.git) Go · 1101 lines

5 "fmt"

6 "math/big"

7 "regexp"

8

9 "github.com/ethereum/go-ethereum/accounts"

17 )

18

19 var isStringAlphaNumeric = regexp.MustCompile(`^[a-zA-Z0-9_-]*$`).MatchString

20

21 //default gas limit to use if not passed in sendTxArgs

resource_aws_iam_policy.go (https://github.com/openshift/installer.git) Go · 316 lines

5 "log"

6 "net/url"

7 "regexp"

8 "time"

9

51 ValidateFunc: validation.All(

52 validation.StringLenBetween(1, 128),

53 validation.StringMatch(regexp.MustCompile(`^[\w+=,.@-]*$`), "must match [\\w+=,.@-]"),

54 ),

55 },

61 ValidateFunc: validation.All(

62 validation.StringLenBetween(1, 96),

63 validation.StringMatch(regexp.MustCompile(`^[\w+=,.@-]*$`), "must match [\\w+=,.@-]"),

64 ),

65 },

resource_ovh_publiccloud_user.go (https://github.com/heap/terraform-ebs-attachmentizer.git) Go · 289 lines

4 "fmt"

5 "log"

6 "regexp"

7 "strconv"

8 "time"

203 }

204

205 var publicCloudUserOSTenantName = regexp.MustCompile("export OS_TENANT_NAME=\"?([[:alnum:]]+)\"?")

206 var publicCloudUserOSTenantId = regexp.MustCompile("export OS_TENANT_ID=\"??([[:alnum:]]+)\"??")

207 var publicCloudUserOSAuthURL = regexp.MustCompile("export OS_AUTH_URL=\"??([[:^space:]]+)\"??")

208 var publicCloudUserOSUsername = regexp.MustCompile("export OS_USERNAME=\"?([[:alnum:]]+)\"?")

confirm.go (https://github.com/AlecAivazis/survey.git) Go · 153 lines

3 import (

4 "fmt"

5 "regexp"

6 )

7

22 }

23

24 // Templates with Color formatting. See Documentation: https://github.com/mgutz/ansi#style-format

25 var ConfirmQuestionTemplate = `

26 {{- if .ShowHelp }}{{- color .Config.Icons.Help.Format }}{{ .Config.Icons.Help.Text }} {{ .Help }}{{color "reset"}}{{"\n"}}{{end}}

34 {{- end}}`

35

36 // the regex for answers

37 var (

38 yesRx = regexp.MustCompile("^(?i:y(?:es)?)$")

size.go (https://gitlab.com/king6cong/gitlab-ci-multi-runner) Go · 95 lines

3 import (

4 "fmt"

5 "regexp"

6 "strconv"

7 "strings"

32 decimalMap = unitMap{"k": KB, "m": MB, "g": GB, "t": TB, "p": PB}

33 binaryMap = unitMap{"k": KiB, "m": MiB, "g": GiB, "t": TiB, "p": PiB}

34 sizeRegex = regexp.MustCompile(`^(\d+)([kKmMgGtTpP])?[bB]?$`)

35 )

36

49 }

50

51 // HumanSize returns a human-readable approximation of a size

52 // using SI standard (eg. "44kB", "17MB").

53 func HumanSize(size float64) string {

config.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 180 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

25 _ = fmt.Print

26 _ = utf8.UTFMax

27 _ = (*regexp.Regexp)(nil)

28 _ = (*strings.Reader)(nil)

29 _ = net.IPv4len

34 )

35

36 // define the regex for a UUID once up-front

37 var _config_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

sqlmock.go (https://github.com/cloudinsight/cloudinsight-agent.git) Go · 457 lines

234

235 if !expected.queryMatches(query) {

236 return nil, fmt.Errorf("exec query '%s', does not match regex '%s'", query, expected.sqlRegex.String())

237 }

238

256 func (c *sqlmock) ExpectExec(sqlRegexStr string) *ExpectedExec {

257 e := &ExpectedExec{}

258 e.sqlRegex = regexp.MustCompile(sqlRegexStr)

259 c.expected = append(c.expected, e)

260 return e

303 func (c *sqlmock) ExpectPrepare(sqlRegexStr string) *ExpectedPrepare {

304 e := &ExpectedPrepare{sqlRegex: regexp.MustCompile(sqlRegexStr), mock: c}

305 c.expected = append(c.expected, e)

306 return e

370 func (c *sqlmock) ExpectQuery(sqlRegexStr string) *ExpectedQuery {

371 e := &ExpectedQuery{}

372 e.sqlRegex = regexp.MustCompile(sqlRegexStr)

373 c.expected = append(c.expected, e)

374 return e

metadata_validation_test.go (https://github.com/knative/pkg.git) Go · 177 lines

37 },

38 want: &FieldError{

39 Message: "not a DNS 1035 label: [a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')]",

40 Paths: []string{"name"},

41 },

55 },

56 want: &FieldError{

57 Message: "not a DNS 1035 label: [a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')]",

58 Paths: []string{"name"},

59 },

76 },

77 want: &FieldError{

78 Message: "not a DNS 1035 label prefix: [a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')]",

79 Paths: []string{"generateName"},

80 },

simplify.go (https://github.com/AsherBond/MondocosmOS-Dependencies.git) Go · 151 lines

13 // The returned regexp may share structure with or be the original.

14 func (re *Regexp) Simplify() *Regexp {

15 if re == nil {

16 return nil

18 switch re.Op {

19 case OpCapture, OpConcat, OpAlternate:

20 // Simplify children, building new Regexp if children change.

21 nre := re

22 for i, sub := range re.Sub {

83

84 // Build leading prefix: xx.

85 var prefix *Regexp

86 if re.Min > 0 {

87 prefix = &Regexp{Op: OpConcat}

132 // Letting them call simplify1 makes sure the expressions they

133 // generate are simple.

134 func simplify1(op Op, flags Flags, sub, re *Regexp) *Regexp {

135 // Special case: repeat the empty string as much as

136 // you want, but it's still the empty string.

chunkedfile.go (https://github.com/google/starlark-go.git) Go · 124 lines

28 "fmt"

29 "io/ioutil"

30 "regexp"

31 "strconv"

32 "strings"

41 filename string

42 report Reporter

43 wantErrs map[int]*regexp.Regexp

44 }

45

69 src := strings.Repeat("\n", linenum-1) + chunk

70

71 wantErrs := make(map[int]*regexp.Regexp)

72

73 // Parse comments of the form:

version.go (https://github.com/rook/rook.git) Go · 300 lines

19 import (

20 "fmt"

21 "regexp"

22 "strconv"

23

53

54 // for parsing the output of `ceph --version`

55 versionPattern = regexp.MustCompile(`ceph version (\d+)\.(\d+)\.(\d+)`)

56

57 // For a build release the output is "ceph version 14.2.4-64.el8cp"

58 // So we need to detect the build version change

59 buildVersionPattern = regexp.MustCompile(`ceph version (\d+)\.(\d+)\.(\d+)\-(\d+)`)

60

61 logger = capnslog.NewPackageLogger("github.com/rook/rook", "cephver")

rewrite.go (https://github.com/EmileVauge/traefik.git) Go · 206 lines

42 next http.Handler

43 errHandler utils.ErrorHandler

44 regexp *regexp.Regexp

45 replacement string

46 rewriteBody bool

49

50 func newRewriteHandler(next http.Handler, spec *Rewrite) (*rewriteHandler, error) {

51 re, err := regexp.Compile(spec.Regexp)

52 if err != nil {

53 return nil, err

145 cli.StringFlag{

146 Name: "replacement",

147 Usage: "replacement text into which regex expansions are inserted",

148 },

149 cli.BoolFlag{

api_op_DeleteLoginProfile.go (https://github.com/aws/aws-k8s-tester.git) Go · 120 lines

35

36 // The name of the user whose password you want to delete. This parameter allows

37 // (through its regex pattern (http://wikipedia.org/wiki/regex)) a string of

38 // characters consisting of upper and lowercase alphanumeric characters with no

39 // spaces. You can also include any of the following characters: _+=,.@-

manifest.go (https://github.com/biggiesmallsAG/nightHawkResponse.git) Go · 257 lines

18 "os"

19 "path/filepath"

20 "regexp"

21 "strings"

22

207 ar.PayloadType = "application/xml"

208

209 re := regexp.MustCompile("generator=\"(.*)\" generatorVersion=\"([0-9.]+)\" ")

210 match := re.FindStringSubmatch(strbuf)

211

rewrite.go (https://github.com/ehazlett/stellar.git) Go · 263 lines

64 // SimpleRule is a simple rewrite rule.

65 type SimpleRule struct {

66 Regexp *regexp.Regexp

67 To string

68 Negate bool

115 httpserver.RequestMatcher

116

117 Regexp *regexp.Regexp

118 }

119

123 // validate regexp if present

124 var r *regexp.Regexp

125 if pattern != "" {

126 var err error

247 }

248

249 func regexpMatches(regexp *regexp.Regexp, base, rPath string) []string {

250 if regexp != nil {

jsonfilelog.go (https://github.com/cloud66/habitus.git) Go · 185 lines

46 if capacity, ok := info.Config["max-size"]; ok {

47 var err error

48 capval, err = units.FromHumanSize(capacity)

49 if err != nil {

50 return nil, err

158 case "labels":

159 case "env":

160 case "env-regex":

161 case "tag":

162 default:

Makefile.in (git://pkgs.fedoraproject.org/mingw-gtkhtml3) Autoconf · 636 lines

209 PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@

210 RANLIB = @RANLIB@

211 REGEX_LIBS = @REGEX_LIBS@

212 SED = @SED@

213 SET_MAKE = @SET_MAKE@

signedmanifesthandler.go (https://gitlab.com/github-cloud-corporation/quayctl) Go · 167 lines

121 }

122

123 if !reference.NameRegexp.MatchString(mnfst.Name) {

124 errs = append(errs,

125 distribution.ErrManifestNameInvalid{

filter.xd.js (http://aipo.googlecode.com/svn/) JavaScript · 73 lines

5 dojo.provide("dojo.data.util.filter");

6

7 dojo.data.util.filter.patternToRegExp = function(/*String*/pattern, /*boolean?*/ ignoreCase){

8 // summary:

9 // Helper function to convert a simple pattern to a regular expression for matching.

62 rxp += "$";

63 if(ignoreCase){

64 return new RegExp(rxp,"i"); //RegExp

65 }else{

66 return new RegExp(rxp); //RegExp

resource_github_repository_collaborator_test.go (https://github.com/terraform-providers/terraform-provider-github.git) Go · 397 lines

5 "errors"

6 "fmt"

7 "regexp"

8 "strings"

9 "testing"

46 testAccCheckGithubRepositoryCollaboratorPermission(rn, permissionPull),

47 resource.TestCheckResourceAttr(rn, "permission", permissionPull),

48 resource.TestMatchResourceAttr(rn, "invitation_id", regexp.MustCompile(`^[0-9]+$`)),

49 ),

50 },

55 testAccCheckGithubRepositoryCollaboratorPermission(rn, permissionPush),

56 resource.TestCheckResourceAttr(rn, "permission", permissionPush),

57 resource.TestMatchResourceAttr(rn, "invitation_id", regexp.MustCompile(`^[0-9]+$`)),

58 ),

59 },

scan.go (https://github.com/holocm/holo.git) Go · 135 lines

24 "bytes"

25 "fmt"

26 "regexp"

27 "sort"

28 "strings"

42 //parse scan output

43 lines := strings.Split(strings.TrimSpace(stdout), "\n")

44 lineRx := regexp.MustCompile(`^\s*([^:]+): (.+)\s*$`)

45 actionRx := regexp.MustCompile(`^([^()]+) \((.+)\)$`)

rate_limit.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 160 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

25 _ = fmt.Print

26 _ = utf8.UTFMax

27 _ = (*regexp.Regexp)(nil)

28 _ = (*strings.Reader)(nil)

29 _ = net.IPv4len

34 )

35

36 // define the regex for a UUID once up-front

37 var _rate_limit_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

msg_test.go (https://gitlab.com/unofficial-mirrors/openshift-origin) Go · 124 lines

3 import (

4 "fmt"

5 "regexp"

6 "strconv"

7 "strings"

17 longDomain = maxPrintableLabel[:53] + strings.TrimSuffix(

18 strings.Join([]string{".", ".", ".", ".", "."}, maxPrintableLabel[:49]), ".")

19 reChar = regexp.MustCompile(`.`)

20 i = -1

21 maxUnprintableLabel = reChar.ReplaceAllStringFunc(maxPrintableLabel, func(ch string) string {

43 ""},

44 {"unprintable label",

45 string(63) + regexp.MustCompile(`\\[0-9]+`).ReplaceAllStringFunc(maxUnprintableLabel,

46 func(escape string) string {

47 n, _ := strconv.ParseInt(escape[1:], 10, 8)

ssh_test.go (https://github.com/cloudfoundry/bosh-cli.git) Go · 405 lines

341 "command": "cleanup",

342 "params": map[string]string{

343 "user_regex": "^user",

344 },

345 "deployment_name": "dep",

371 "command": "cleanup",

372 "params": map[string]string{

373 "user_regex": "^user",

374 },

375 "deployment_name": "dep",

clusterList.go (https://gitlab.com/oytunistrator/yoke) Go · 78 lines

12 "net/rpc"

13 "os"

14 "regexp"

15 "time"

16

66

67 //

68 if subMatch := regexp.MustCompile(`^\((.*)\)(.*)$`).FindStringSubmatch(member.State); subMatch != nil {

69 state = subMatch[1]

70 status = subMatch[2]

lua.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 218 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

25 _ = fmt.Print

26 _ = utf8.UTFMax

27 _ = (*regexp.Regexp)(nil)

28 _ = (*strings.Reader)(nil)

29 _ = net.IPv4len

34 )

35

36 // define the regex for a UUID once up-front

37 var _lua_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

base.pb.validate.go (https://github.com/open-policy-agent/opa-istio-plugin.git) Go · 1822 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

25 _ = fmt.Print

26 _ = utf8.UTFMax

27 _ = (*regexp.Regexp)(nil)

28 _ = (*strings.Reader)(nil)

29 _ = net.IPv4len

873 return HeaderValueValidationError{

874 field: "Key",

875 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",

876 }

877 }

table.go (https://github.com/kgretzky/evilginx2.git) Go · 164 lines

10 import (

11 "fmt"

12 "regexp"

13 "strings"

14 "unicode/utf8"

18

19 func viewLen(s string) int {

20 var ansi = regexp.MustCompile("\033\\[(?:[0-9]{1,3}(?:;[0-9]{1,3})*)?[m|K]")

21 for _, m := range ansi.FindAllString(s, -1) {

26

27 func truncString(s string, maxLen int) string {

28 var ansi = regexp.MustCompile("\033\\[(?:[0-9]{1,3}(?:;[0-9]{1,3})*)?[m|K]")

29 sm := s

30 for _, m := range ansi.FindAllString(sm, -1) {

parse.go (https://gitlab.com/admin-github-cloud/quayctl) Go · 257 lines

7 "errors"

8 "fmt"

9 "regexp"

10 "strings"

11 )

172 fieldValues := filters.fields[field]

173 for name2match := range fieldValues {

174 match, err := regexp.MatchString(name2match, source)

175 if err != nil {

176 continue

main.go (https://code.google.com/p/godag/) Go · 546 lines ✨ Summary

The code is a command-line tool called godag that compiles and builds Go projects. It takes a source directory as input, parses command-line options, and performs various actions such as formatting code, linking binaries, and running unit tests. The output includes information about the compiled project, such as package info, compile order, and test results.

503 -q --quiet silent, print only errors

504 -L --lib write objects to other dir (!src)

505 -M --main regex to select main package

506 -a --all link main pkgs to bin/nameOfMainDir

507 -D --dot create a graphviz dot file

508 -I import package directories

509 -t --test run all unit-tests

510 -m --match regex to select unit-tests

511 -b --bench regex to select benchmarks

project_util.go (https://github.com/operator-framework/operator-sdk.git) Go · 157 lines

19 "io/ioutil"

20 "os"

21 "regexp"

22 "strings"

23

47 // OperatorTypeGo - golang type of operator.

48 OperatorTypeGo OperatorType = "go"

49 // OperatorTypeAnsible - ansible type of operator.

50 OperatorTypeAnsible OperatorType = "ansible"

101 case strings.HasPrefix(pluginKey, "helm"):

102 return OperatorTypeHelm

103 case strings.HasPrefix(pluginKey, "ansible"):

104 return OperatorTypeAnsible

107 }

108

109 var flagRe = regexp.MustCompile("(.* )?-v(.* )?")

110

111 // SetGoVerbose sets GOFLAGS="${GOFLAGS} -v" if GOFLAGS does not

base.pb.validate.go (https://github.com/alipay/sofa-mosn.git) Go · 1534 lines

11 "net/mail"

12 "net/url"

13 "regexp"

14 "strings"

15 "time"

25 _ = fmt.Print

26 _ = utf8.UTFMax

27 _ = (*regexp.Regexp)(nil)

28 _ = (*strings.Reader)(nil)

29 _ = net.IPv4len

34 )

35

36 // define the regex for a UUID once up-front

37 var _base_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

riak.go (https://code.google.com/p/goriak/) Go · 530 lines ✨ Summary

This Go code implements a client for interacting with a Riak NoSQL database using its REST API. It provides methods for making GET, PUT, and other requests to the database, as well as an asynchronous request API that allows for concurrent requests. The code also includes support for callbacks and response channels, enabling developers to handle responses in a flexible manner.

49 "strconv"

50 "strings"

51 "regexp"

52 //"fmt"

53 )

305 location, ok := resp.Header["Location"]

306 if ok {

307 // TODO: regexp would be much cleaner

308 parts := strings.Split(location, "/", -1)

309 if len(parts) > 3 {

371 links, ok := resp.Header["Link"]

372 if ok {

373 // This should all be REGEXP but just haven't gotten around to

374 // it yet.

375 var LINK_SPLITTER = regexp.MustCompile("^<.*,")

date.go (https://github.com/alibaba/pouch.git) Go · 152 lines

19 "errors"

20 "fmt"

21 "regexp"

22 "time"

23

52

53 var (

54 rxDate = regexp.MustCompile(DatePattern)

55 )

56

sysinfo.go (https://gitlab.com/unofficial-mirrors/kubernetes) Go · 203 lines

17 import (

18 "fmt"

19 "regexp"

20 "strconv"

21 "strings"

25 )

26

27 var schedulerRegExp = regexp.MustCompile(`.*\[(.*)\].*`)

28

29 // Get information about block devices present on the system.

69 blkSched, err := sysfs.GetBlockDeviceScheduler(name)

70 if err == nil {

71 matches := schedulerRegExp.FindSubmatch([]byte(blkSched))

72 if len(matches) >= 2 {

73 disk_info.Scheduler = string(matches[1])

_base.js (http://aipo.googlecode.com/svn/) JavaScript · 633 lines

502 }

503 if(typeof args[0] == "string"){

504 // Strings before regexes for speed

505 registry.params.unshift(params);

506 }else{

570 // description:

571 // When we are looking up a tag as specified in a template, we either use a

572 // string in the fns array, or the RegExp item of the [RegExp, String] pair.

573 // When that string is found, it requires the file specified in the require

574 // parameter, uses the base object as a starting point and checks for obj.fn

587 // description:

588 // When we are looking up a tag as specified in a template, we either use a

589 // string in the fns array, or the RegExp item of the [RegExp, String] pair.

590 // When that string is found, it requires the file specified in the require

591 // parameter, uses the base object as a starting point and checks for obj.fn

regress-307456.js (https://bitbucket.org/ultra_iter/qt-vtl.git) JavaScript · 54 lines

39 //-----------------------------------------------------------------------------

40 var BUGNUMBER = 307456;

41 var summary = 'Do not Freeze with RegExp';

42 var actual = 'No Crash';

43 var expect = 'No Crash';

49

50 printStatus(data);

51 data=data.replace(RegExp('<!--(\\n[^\\n]|[^-]|-[^-]|--[^>])*-->', 'g'), '');

52 printStatus(data);

53

files.xd.js (http://aipo.googlecode.com/svn/) JavaScript · 453 lines

299 var matches;

300 var text = sheet.cssText.toString();

301 // unfortunately, using RegExp.exec seems to be flakey

302 // for looping across multiple lines on IE using the

303 // global flag, so we have to simulate it

QtOpenGL.4.1.0.win32-gcc-ia32.txt (https://bitbucket.org/ultra_iter/qt-vtl.git) Plain Text · 17675 lines

309 vptr=((&QDataStream::_ZTV11QDataStream) + 8u)

310

311 Class QRegExp

312 size=4 align=4

313 base size=4 base align=4

314 QRegExp (0xeac380) 0

315

316 Class QStringMatcher

fuse_gtest_files.py (https://bitbucket.org/ultra_iter/qt-vtl.git) Python · 250 lines

68 DEFAULT_GTEST_ROOT_DIR = os.path.join(os.path.dirname(__file__), '..')

69

70 # Regex for matching '#include <gtest/...>'.

71 INCLUDE_GTEST_FILE_REGEX = re.compile(r'^\s*#\s*include\s*<(gtest/.+)>')

72

73 # Regex for matching '#include "src/..."'.

74 INCLUDE_SRC_FILE_REGEX = re.compile(r'^\s*#\s*include\s*"(src/.+)"')

161 # Reads each line in the given gtest header.

162 for line in file(os.path.join(gtest_root, gtest_header_path), 'r'):

163 m = INCLUDE_GTEST_FILE_REGEX.match(line)

164 if m:

165 # It's '#include <gtest/...>' - let's process it recursively.

189 # Reads each line in the given gtest source file.

190 for line in file(os.path.join(gtest_root, gtest_source_file), 'r'):

191 m = INCLUDE_GTEST_FILE_REGEX.match(line)

192 if m:

193 if 'include/' + m.group(1) == GTEST_SPI_H_SEED:

web.xd.js (http://aipo.googlecode.com/svn/) JavaScript · 94 lines

41 // flags in regexp.tld can be applied.

42

43 var re = new RegExp("^" + dojox.regexp.url(flags) + "$", "i");

44 return re.test(value); // Boolean

45 }

55 // flags in regexp.tld can be applied.

56

57 var re = new RegExp("^" + dojox.regexp.emailAddress(flags) + "$", "i");

58 return re.test(value); // Boolean

59 }

70 // flags in regexp.tld can be applied.

71

72 var re = new RegExp("^" + dojox.regexp.emailAddressList(flags) + "$", "i");

73 return re.test(value); // Boolean

74 }

stamp.xd.js (http://aipo.googlecode.com/svn/) JavaScript · 131 lines

37 // Uses 1970-01-01T00:00:00.0Z by default.

38

39 if(!dojo.date.stamp._isoRegExp){

40 dojo.date.stamp._isoRegExp =

43 }

44

45 var match = dojo.date.stamp._isoRegExp.exec(formattedString);

46 var result = null;

47

ack-ignore-dir.t (git://pkgs.fedoraproject.org/ack) Perl · 149 lines

42

43 # ignore everything in .svn directories

44 my $svn_regex = quotemeta File::Spec->catfile( '', '.svn', '' ); # the respective filesystem equivalent of '/.svn/'

45 @results = grep { ! m/$svn_regex/ } @results;