100+ results for 'regex uuid lang:go'
Not the results you expected?
rules.go (https://github.com/kubernetes/autoscaler.git) Go · 171 lines
53 // UUIDv3 validates if a string is a valid version 3 UUID
54 UUIDv3 = validation.NewStringRule(govalidator.IsUUIDv3, "must be a valid UUID v3")
55 // UUIDv4 validates if a string is a valid version 4 UUID
56 UUIDv4 = validation.NewStringRule(govalidator.IsUUIDv4, "must be a valid UUID v4")
57 // UUIDv5 validates if a string is a valid version 5 UUID
58 UUIDv5 = validation.NewStringRule(govalidator.IsUUIDv5, "must be a valid UUID v5")
59 // UUID validates if a string is a valid UUID
60 UUID = validation.NewStringRule(govalidator.IsUUID, "must be a valid UUID")
61 // CreditCard validates if a string is a valid credit card number
62 CreditCard = validation.NewStringRule(govalidator.IsCreditCard, "must be a valid credit card number")
126 reDigit = regexp.MustCompile("^[0-9]+$")
127 // Subdomain regex source: https://stackoverflow.com/a/7933253
128 reSubdomain = regexp.MustCompile(`^[A-Za-z0-9](?:[A-Za-z0-9\-]{0,61}[A-Za-z0-9])?$`)
thrift_proxy.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 317 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 )
36 // define the regex for a UUID once up-front
37 var _thrift_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}$")
quobyte.go (https://github.com/trailofbits/audit-kubernetes.git) Go · 203 lines
50 log.Printf("Tenant name resolution: Resolving %s to UUID\n", request.TenantID)
51 tenantUUID, err := client.ResolveTenantNameToUUID(request.TenantID)
52 if err != nil {
53 return "", err
64 }
66 // ResolveVolumeNameToUUID resolves a volume name to a UUID
67 func (client *QuobyteClient) ResolveVolumeNameToUUID(volumeName, tenant string) (string, error) {
185 // IsValidUUID Validates given uuid
186 func IsValidUUID(uuid string) bool {
187 r := regexp.MustCompile("^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[8|9|aA|bB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$")
189 }
191 // ResolveTenantNameToUUID Returns UUID for given name, error if not found.
192 func (client *QuobyteClient) ResolveTenantNameToUUID(name string) (string, error) {
data_source_alicloud_polardb_clusters.go (https://github.com/terraform-providers/terraform-provider-alicloud.git) Go · 328 lines
3 import (
4 "regexp"
6 "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
17 Schema: map[string]*schema.Schema{
18 "description_regex": {
19 Type: schema.TypeString,
20 Optional: true,
21 ValidateFunc: validation.ValidateRegexp,
22 },
23 "ids": {
192 var dbi []polardb.DBCluster
194 var descriptionRegex *regexp.Regexp
195 if v, ok := d.GetOk("description_regex"); ok {
config.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 203 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 )
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}$")
searcher.go (https://github.com/ClusterHQ/fli.git) Go · 493 lines
40 // (empty string)
41 func FindVolumesets(mds metastore.Syncable, search string) ([]*volumeset.VolumeSet, error) {
42 searchByUUID, err := uuid.IsUUID(search)
43 if err != nil {
44 return nil, err
274 } else {
275 // Search is an id then simply search for that ID
276 isShrunkID, err := uuid.IsShrunkUUID(search)
277 if err != nil {
278 return snapFound, err
334 )
336 check, err := uuid.IsUUID(search)
337 if err != nil {
338 return volFound, err
legacy_deployment_state_migrator.go (https://github.com/cloudfoundry/bosh-cli.git) Go · 169 lines
11 biproperty "github.com/cloudfoundry/bosh-utils/property"
12 boshsys "github.com/cloudfoundry/bosh-utils/system"
13 boshuuid "github.com/cloudfoundry/bosh-utils/uuid"
14 )
21 deploymentStateService DeploymentStateService
22 fs boshsys.FileSystem
23 uuidGenerator boshuuid.Generator
24 logger boshlog.Logger
25 logTag string
89 deploymentState.DirectorID = legacyDeploymentState.Instances[0].UUID
90 } else {
91 uuid, err := m.uuidGenerator.Generate()
92 if err != nil {
93 return deploymentState, bosherr.WrapError(err, "Generating UUID")
resolver_api.pb.validate.go (https://github.com/lyft/clutch.git) Go · 551 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 )
36 // define the regex for a UUID once up-front
37 var _resolver_api_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}$")
matcher.pb.validate.go (https://github.com/envoyproxy/go-control-plane.git) Go · 585 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 )
36 // define the regex for a UUID once up-front
37 var _matcher_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}$")
string.pb.validate.go (https://github.com/envoyproxy/go-control-plane.git) Go · 252 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 )
36 // define the regex for a UUID once up-front
37 var _string_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}$")
70 }
72 case *StringMatcher_Regex:
74 if len(m.GetRegex()) > 1024 {
als.pb.validate.go (https://github.com/envoyproxy/go-control-plane.git) Go · 488 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 )
36 // define the regex for a UUID once up-front
37 var _als_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}$")
filters.go (https://github.com/redhat-cip/skydive.git) Go · 229 lines
23 package filters
25 import "regexp"
27 type Getter interface {
52 return f.LteInt64Filter.Eval(g)
53 }
54 if f.RegexFilter != nil {
55 return f.RegexFilter.Eval(g)
140 }
142 func (r *RegexFilter) Eval(g Getter) bool {
143 field, err := g.GetFieldString(r.Key)
144 if err != nil {
204 terms := make([]*Filter, len(uuids)*len(attrs))
205 for i, uuid := range uuids {
206 for j, attr := range attrs {
207 terms[i*len(attrs)+j] = NewTermStringFilter(attr, uuid)
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 )
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
152 if v, ok := interface{}(m.GetRegexValueRewrite()).(interface{ Validate() error }); ok {
153 if err := v.Validate(); err != nil {
154 return Config_KeyValuePairValidationError{
rfc4122_test.go (https://github.com/aws/amazon-ssm-agent.git) Go · 209 lines
28 t.Errorf("Expected RFC4122 variant %x, but got %x", ReservedRFC4122, u.Variant())
29 }
30 if !parseUUIDRegex.MatchString(u.String()) {
31 t.Errorf("Expected string representation to be valid, given: %s", u.String())
32 }
48 t.Errorf("Expected RFC4122 variant %x, but got %x", ReservedRFC4122, u.Variant())
49 }
50 if !parseUUIDRegex.MatchString(u.String()) {
51 t.Errorf("Expected string representation to be valid, given: %s", u.String())
52 }
116 t.Errorf("Expected RFC4122 variant %x, but got %x", ReservedRFC4122, u.Variant())
117 }
118 if !parseUUIDRegex.MatchString(u.String()) {
119 t.Errorf("Expected string representation to be valid, given: %s", u.String())
120 }
route.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 310 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 )
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}$")
78 return RouteConfigurationValidationError{
79 field: fmt.Sprintf("InternalOnlyHeaders[%v]", idx),
80 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
81 }
82 }
header_to_metadata.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 316 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 )
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}$")
231 return Config_RuleValidationError{
232 field: "Header",
233 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
234 }
235 }
service.pb.validate.go (https://github.com/hb-go/micro-mesh.git) Go · 537 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 )
36 // define the regex for a UUID once up-front
37 var _service_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}$")
endpoint_components.pb.validate.go (https://github.com/XiaoMi/naftis.git) Go · 425 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 )
40 // define the regex for a UUID once up-front
41 var _endpoint_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}$")
attribute_context.pb.validate.go (https://github.com/envoyproxy/go-control-plane.git) Go · 408 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 )
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}$")
dns_table.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 430 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 )
36 // define the regex for a UUID once up-front
37 var _dns_table_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}$")
334 return DnsTable_DnsVirtualDomainValidationError{
335 field: "Name",
336 reason: "value does not match regex pattern \"^:?[0-9a-zA-Z!#$%&'*+-.^_|~`]+$\"",
337 }
338 }
route.pb.validate.go (https://github.com/envoyproxy/go-control-plane.git) Go · 397 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 )
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}$")
string.go (https://github.com/blend/go-sdk.git) Go · 289 lines
12 "net/mail"
13 "net/url"
14 "regexp"
15 "strings"
16 "unicode"
31 ErrStringIsLower ex.Class = "string should be lowercase"
32 ErrStringIsTitle ex.Class = "string should be titlecase"
33 ErrStringIsUUID ex.Class = "string should be a uuid"
34 ErrStringIsEmail ex.Class = "string should be a valid email address"
35 ErrStringIsURI ex.Class = "string should be a valid uri"
196 }
198 // IsUUID returns if a string is a valid uuid.
199 // It will error if the string is unset (nil).
200 func (s StringValidators) IsUUID() Validator {
model.go (https://github.com/mmcgrana/pgpin.git) Go · 360 lines
3 import (
4 "code.google.com/p/go-uuid/uuid"
5 "database/sql"
6 "github.com/jrallison/go-workers"
12 // Constants.
14 var DataUuidRegexp = regexp.MustCompilePOSIX("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}")
16 // Structs.
115 func DbGet(idOrName string) (*Db, error) {
116 var row *sql.Row
117 if DataUuidRegexp.MatchString(idOrName) {
118 query := "SELECT id, name, url_encrypted, created_at, updated_at, version FROM dbs WHERE deleted_at is NULL AND (id=$1 OR name=$2) LIMIT 1"
119 row = PgConn.QueryRow(query, idOrName, idOrName)
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 )
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}$")
prepared_query.go (https://github.com/cilium/cilium.git) Go · 217 lines
76 Type string
78 // Regexp allows specifying a regex pattern to match against the name
79 // of the query being executed.
80 Regexp string
83 // PreparedQueryDefinition defines a complete prepared query.
84 type PreparedQueryDefinition struct {
85 // ID is this UUID-based ID for the query, always generated by Consul.
86 ID string
authn.pb.validate.go (https://github.com/lyft/clutch.git) Go · 311 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 )
36 // define the regex for a UUID once up-front
37 var _authn_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}$")
results.go (https://github.com/kris-nova/kubicorn.git) Go · 316 lines
58 // Specifies the name of this rule.
59 Name string `mapstructure:"name" json:"name"`
60 // Specifies the request URL this rule should match for this origin to be used. Regex is supported.
61 RequestURL string `mapstructure:"request_url" json:"request_url"`
62 }
123 // Specifies the name of this rule.
124 Name string `mapstructure:"name" json:"name"`
125 // Specifies the request URL this rule should match for this TTL to be used. Regex is supported.
126 RequestURL string `mapstructure:"request_url" json:"request_url"`
127 }
202 type Service struct {
203 // Specifies the service ID that represents distributed content. The value is
204 // a UUID, such as 96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0, that is generated by the server.
205 ID string `mapstructure:"id"`
206 // Specifies the name of the service.
health_check.pb.validate.go (https://github.com/Kong/kuma.git) Go · 291 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 )
36 // define the regex for a UUID once up-front
37 var _health_check_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}$")
quobyte.go (https://github.com/turbonomic/kubeturbo.git) Go · 245 lines
52 var response volumeUUID
53 tenantUUID, err := client.GetTenantUUID(request.TenantID)
54 if err != nil {
55 return "", err
64 }
66 // GetVolumeUUID resolves the volumeUUID for the given volume and tenant name.
67 // This method should be used when it is not clear if the given string is volume UUID or Name.
72 return "", err
73 }
74 volUUID, err := client.ResolveVolumeNameToUUID(volume, tenantUUID)
75 if err != nil {
76 return "", err
133 // DeleteVolumeByName deletes a volume by a given name
134 func (client *QuobyteClient) DeleteVolumeByName(volumeName, tenant string) error {
135 uuid, err := client.ResolveVolumeNameToUUID(volumeName, tenant)
136 if err != nil {
137 return err
resource_arm_lighthouse_definition_test.go (https://github.com/terraform-providers/terraform-provider-azurerm.git) Go · 283 lines
33 testCheckAzureRMLighthouseDefinitionExists(data.ResourceName),
34 resource.TestCheckResourceAttrSet(data.ResourceName, "scope"),
35 resource.TestMatchResourceAttr(data.ResourceName, "lighthouse_definition_id", validate.UUIDRegExp),
36 ),
37 },
56 testCheckAzureRMLighthouseDefinitionExists(data.ResourceName),
57 resource.TestCheckResourceAttrSet(data.ResourceName, "scope"),
58 resource.TestMatchResourceAttr(data.ResourceName, "lighthouse_definition_id", validate.UUIDRegExp),
59 ),
60 },
82 testCheckAzureRMLighthouseDefinitionExists(data.ResourceName),
83 resource.TestCheckResourceAttrSet(data.ResourceName, "scope"),
84 resource.TestMatchResourceAttr(data.ResourceName, "lighthouse_definition_id", validate.UUIDRegExp),
85 resource.TestCheckResourceAttr(data.ResourceName, "description", "Acceptance Test Lighthouse Definition"),
86 ),
k8s.pb.validate.go (https://github.com/lyft/clutch.git) Go · 313 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 )
36 // define the regex for a UUID once up-front
37 var _k_8_s_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}$")
outlier_detection_event.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 432 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 )
36 // define the regex for a UUID once up-front
37 var _outlier_detection_event_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}$")
validation.go (https://github.com/redhat-developer/odo.git) Go · 163 lines
3 import (
4 "fmt"
5 "regexp"
7 "k8s.io/apimachinery/pkg/util/validation/field"
13 )
15 var ParameterNameRegexp = regexp.MustCompile(`^[a-zA-Z0-9_]+$`)
17 // ValidateParameter tests if required fields in the Parameter are set.
128 }
130 var uuidRegex = regexp.MustCompile("^(?i)[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
132 func nameIsUUID(name string, prefix bool) []string {
133 if uuidRegex.MatchString(name) {
134 return nil
135 }
provider_test.go (https://github.com/EmileVauge/traefik.git) Go · 399 lines
init_dump.pb.validate.go (https://github.com/envoyproxy/go-control-plane.git) Go · 189 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 )
36 // define the regex for a UUID once up-front
37 var _init_dump_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}$")
scoped_route.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 306 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 )
36 // define the regex for a UUID once up-front
37 var _scoped_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}$")
regex.pb.validate.go (https://github.com/envoyproxy/go-control-plane.git) Go · 294 lines
1 // Code generated by protoc-gen-validate. DO NOT EDIT.
2 // source: envoy/type/matcher/regex.proto
4 package envoy_type_matcher
25 _ = fmt.Print
26 _ = utf8.UTFMax
27 _ = (*regexp.Regexp)(nil)
28 _ = (*strings.Reader)(nil)
29 _ = net.IPv4len
36 // define the regex for a UUID once up-front
37 var _regex_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}$")
39 // Validate checks the field values on RegexMatcher with the rules defined in
107 // ErrorName returns error name.
108 func (e RegexMatcherValidationError) ErrorName() string { return "RegexMatcherValidationError" }
110 // Error satisfies the builtin error interface
utils.go (https://github.com/starkandwayne/shield.git) Go · 269 lines
requests.go (https://github.com/openshift/installer.git) Go · 384 lines
30 CompareTypeEndWith CompareType = "ENDS_WITH"
31 CompareTypeEqual CompareType = "EQUAL_TO"
32 CompareTypeRegex CompareType = "REGEX"
33 CompareTypeStartWith CompareType = "STARTS_WITH"
34 )
52 Description string `json:"description,omitempty"`
54 // TenantID is the UUID of the tenant who owns the L7 policy in octavia.
55 // Only administrative users can specify a project UUID other than their own.
225 RuleType RuleType `json:"type" required:"true"`
227 // The comparison type for the L7 rule. One of CONTAINS, ENDS_WITH, EQUAL_TO, REGEX, or STARTS_WITH.
228 CompareType CompareType `json:"compare_type" required:"true"`
231 Value string `json:"value" required:"true"`
233 // TenantID is the UUID of the tenant who owns the rule in octavia.
234 // Only administrative users can specify a project UUID other than their own.
operators_test.go (https://bitbucket.org/asardak/atm-store.git) Go · 231 lines
68 {"customIn", customIn(f("name"), "Joe", "Jane"), 2},
69 {"NotIn", NotIn(f("name"), "Joe", "Jane"), 1},
70 {"MatchRegexCase upper", MatchRegexCase(f("name"), "J.*"), 2},
71 {"MatchRegexCase lower", MatchRegexCase(f("name"), "j.*"), 0},
72 {"MatchRegex upper", MatchRegex(f("name"), "J.*"), 2},
73 {"MatchRegex lower", MatchRegex(f("name"), "j.*"), 2},
74 {"NotMatchRegexCase upper", NotMatchRegexCase(f("name"), "J.*"), 1},
75 {"NotMatchRegexCase lower", NotMatchRegexCase(f("name"), "j.*"), 3},
76 {"NotMatchRegex upper", NotMatchRegex(f("name"), "J.*"), 1},
77 {"NotMatchRegex lower", NotMatchRegex(f("name"), "j.*"), 1},
92 func (s *OpsSuite) TestArrayOperators() {
93 s.create(`CREATE TABLE slices (
94 id uuid PRIMARY KEY,
95 elems bigint[]
96 )`)
matter_model.go (https://github.com/eyebluecn/tank.git) Go · 158 lines
9 jsoniter "github.com/json-iterator/go"
10 "net/http"
11 "regexp"
12 "strings"
13 "time"
16 const (
17 //root matter's uuid
18 MATTER_ROOT = "root"
19 //cache directory name.
32 type Matter struct {
33 Base
34 Puuid string `json:"puuid" gorm:"type:char(36);index:idx_puuid"`
35 UserUuid string `json:"userUuid" gorm:"type:char(36);index:idx_uu"`
69 matter.Uuid = MATTER_ROOT
70 matter.UserUuid = user.Uuid
71 matter.Username = user.Username
72 matter.Dir = true
config_source.pb.validate.go (https://github.com/rancher/rio.git) Go · 525 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 )
36 // define the regex for a UUID once up-front
37 var _config_source_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}$")
value.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 320 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 )
36 // define the regex for a UUID once up-front
37 var _value_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}$")
clusters.pb.validate.go (https://github.com/XiaoMi/naftis.git) Go · 436 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 )
40 // define the regex for a UUID once up-front
41 var _clusters_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}$")
utils.go (https://github.com/dnote/dnote.git) Go · 48 lines
21 import (
22 "regexp"
24 "github.com/google/uuid"
26 )
28 // GenerateUUID returns a uuid v4 in string
29 func GenerateUUID() (string, error) {
30 u, err := uuid.NewRandom()
31 if err != nil {
32 return "", errors.Wrap(err, "generating uuid")
36 }
38 // regexNumber is a regex that matches a string that looks like an integer
39 var regexNumber = regexp.MustCompile(`^\d+$`)
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 )
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}$")
event_service_config.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 126 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 )
36 // define the regex for a UUID once up-front
37 var _event_service_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}$")
gatt_tool_test.go (https://gitlab.com/brucealdridge/driver-go-blecombined) Go · 42 lines
10 )
12 func TestCharacteristicsRegex(t *testing.T) {
13 line := "handle = 0x0002, char properties = 0x0a, char value handle = 0x0003, uuid = 00002a00-0000-1000-8000-00805f9b34fb"
25 if params["uuid"] != "00002a00-0000-1000-8000-00805f9b34fb" {
26 t.Errorf("bad characteristic uuid %v", params["uuid"])
27 }
28 }
discovery.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 487 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 )
36 // define the regex for a UUID once up-front
37 var _discovery_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/cilium/cilium.git) Go · 517 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 )
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}$")
datasource_digitalocean_loadbalancer_test.go (https://github.com/terraform-providers/terraform-provider-digitalocean.git) Go · 185 lines
4 "context"
5 "fmt"
6 "regexp"
7 "testing"
18 rInt := acctest.RandInt()
20 expectedURNRegEx, _ := regexp.Compile(`do:loadbalancer:[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}`)
22 resource.Test(t, resource.TestCase{
51 "data.digitalocean_loadbalancer.foobar", "droplet_ids.#", "2"),
52 resource.TestMatchResourceAttr(
53 "data.digitalocean_loadbalancer.foobar", "urn", expectedURNRegEx),
54 resource.TestCheckResourceAttrSet(
55 "data.digitalocean_loadbalancer.foobar", "vpc_uuid"),
exporterd.go (https://github.com/gluster/gluster-prometheus.git) Go · 179 lines
8 "os/exec"
9 "path/filepath"
10 "regexp"
11 "strings"
12 "time"
18 var (
19 peerIDPattern = regexp.MustCompile("[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}")
20 )
32 }
33 var maxPeerID string
34 //This for loop iterates among all the peers and finds the peer with the maximum UUID (lexicographically)
35 for i, pr := range peerList {
36 if pr.Online {
mysql.go (https://github.com/gobuffalo/fizz.git) Go · 300 lines
3 import (
4 "fmt"
5 "regexp"
6 "strings"
216 if c.Options["default"] != nil {
217 d := fmt.Sprintf("%#v", c.Options["default"])
218 re := regexp.MustCompile("^(\")(.+)(\")$")
219 d = re.ReplaceAllString(d, "'$2'")
220 s = fmt.Sprintf("%s DEFAULT %s", s, d)
239 }
240 return fmt.Sprintf("VARCHAR (%s)", s)
241 case "uuid":
242 return "char(36)"
243 case "timestamp", "time", "datetime":
requests.go (https://github.com/kubeup/archon.git) Go · 156 lines
41 sh := make(map[string]interface{})
43 uuidRegex, _ := regexp.Compile("^[a-z0-9]{8}-[a-z0-9]{4}-[1-5][a-z0-9]{3}-[a-z0-9]{4}-[a-z0-9]{12}$")
45 if opts.Group != "" {
46 if !uuidRegex.MatchString(opts.Group) {
47 err := gophercloud.ErrInvalidInput{}
48 err.Argument = "schedulerhints.SchedulerHints.Group"
56 if len(opts.DifferentHost) > 0 {
57 for _, diffHost := range opts.DifferentHost {
58 if !uuidRegex.MatchString(diffHost) {
59 err := gophercloud.ErrInvalidInput{}
60 err.Argument = "schedulerhints.SchedulerHints.DifferentHost"
util_test.go (https://github.com/dollarshaveclub/furan.git) Go · 405 lines
appiconset.go (https://github.com/bitrise-io/codesigndoc.git) Go · 172 lines
5 "path"
6 "path/filepath"
7 "regexp"
8 "strings"
77 }
79 re := regexp.MustCompile(`\$\{(.+)\}`)
80 wildcharAppIconSetName := re.ReplaceAllString(appIconSetName, "*")
82 matches, err := filepath.Glob(path.Join(regexp.QuoteMeta(resolvedPath), wildcharAppIconSetName+".appiconset"))
83 if err != nil {
84 return nil, err
list_collections.go (https://github.com/scality/Zenko.git) Go · 141 lines
17 "go.mongodb.org/mongo-driver/x/mongo/driver/session"
18 "go.mongodb.org/mongo-driver/x/mongo/driver/topology"
19 "go.mongodb.org/mongo-driver/x/mongo/driver/uuid"
20 "go.mongodb.org/mongo-driver/x/network/command"
21 "go.mongodb.org/mongo-driver/x/network/connection"
33 topo *topology.Topology,
34 selector description.ServerSelector,
35 clientID uuid.UUID,
36 pool *session.Pool,
37 opts ...*options.ListCollectionsOptions,
116 // returns the original filter if the name field is not present or a copy with the modified name field if it is
117 func transformFilter(filter bsonx.Doc, dbName string) (bsonx.Doc, error) {
118 regexFilter := bsonx.Doc{
119 {"name", bsonx.Regex("^[^$]*$", "")},
122 if filter == nil {
123 return regexFilter, nil
124 }
formatters.go (https://github.com/ghetzel/pivot.git) Go · 287 lines
6 "encoding/hex"
7 "fmt"
8 "regexp"
9 "strings"
10 "time"
50 func GetFormatter(name string, args interface{}) (FieldFormatterFunc, error) {
51 switch name {
52 case `uuid`:
53 return GenerateUUID, nil
55 case `encoded-uuid`:
56 var encoder EncoderFunc
67 }
69 return GenerateEncodedUUID(encoder), nil
71 case `trim-space`:
adagio.xml.html (https://github.com/OneWingedShark/adagio.git) HTML · 410 lines
349 <font color="#0000ff"> * substring: any user agent containing this substring</font>
350 <font color="#0000ff"> will be banned</font>
351 <font color="#0000ff"> * regexp: file-like regular expressions.</font>
352 <font color="#0000ff"> Must match the whole user agent</font>
353 <font color="#0000ff"> --</font><font color="#0000ff">></font>
354 <font color="#008080"><</font><font color="#008080">ban</font><font color="#008080"> </font><font color="#2e8b57"><b>client</b></font>=<font color="#ff00ff">"bearshare"</font><font color="#008080"> </font><font color="#2e8b57"><b>type</b></font>=<font color="#ff00ff">"substring"</font><font color="#008080"> </font><font color="#2e8b57"><b>active</b></font>=<font color="#ff00ff">"no"</font><font color="#008080"> </font><font color="#008080">/></font>
355 <font color="#008080"><</font><font color="#008080">ban</font><font color="#008080"> </font><font color="#2e8b57"><b>client</b></font>=<font color="#ff00ff">"bear*4.2.3*"</font><font color="#008080"> </font><font color="#2e8b57"><b>type</b></font>=<font color="#ff00ff">"regexp"</font><font color="#008080"> </font><font color="#2e8b57"><b>active</b></font>=<font color="#ff00ff">"no"</font><font color="#008080"> </font><font color="#008080">/></font>
357 <font color="#0000ff"><!</font><font color="#0000ff">-- Country bannings. You can ban countries or allow them against the</font>
dns_cache.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 270 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 )
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}$")
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 }
124 case "regexp_replace":
125 if err := validateLen(name, 3, len); err != nil {
126 return err
283 return produceErrInfo(name, 1, "float")
284 }
285 case "newuuid":
286 if err := validateLen(name, 0, len); err != nil {
287 return err
user_event.go (https://github.com/hashicorp/ngx_http_consul_backend_module.git) Go · 265 lines
3 import (
4 "fmt"
5 "regexp"
7 "github.com/hashicorp/consul/agent/structs"
8 "github.com/hashicorp/go-uuid"
9 )
81 // Format message
82 var err error
83 if params.ID, err = uuid.GenerateUUID(); err != nil {
84 return fmt.Errorf("UUID generation failed: %v", err)
162 }
164 var tagRe *regexp.Regexp
165 if msg.TagFilter != "" {
166 re, err := regexp.Compile(msg.TagFilter)
http_uri.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 155 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 )
36 // define the regex for a UUID once up-front
37 var _http_uri_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 · 486 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 )
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}$")
path_role_create.go (https://github.com/Caiyeon/goldfish.git) Go · 120 lines
4 "fmt"
6 "github.com/hashicorp/go-uuid"
7 "github.com/hashicorp/vault/logical"
8 "github.com/hashicorp/vault/logical/framework"
47 // Ensure username is unique
48 uuidVal, err := uuid.GenerateUUID()
49 if err != nil {
50 return nil, err
52 username := fmt.Sprintf("%s-%s", req.DisplayName, uuidVal)
54 password, err := uuid.GenerateUUID()
55 if err != nil {
56 return nil, err
list_test.go (https://github.com/dotcloud/docker.git) Go · 144 lines
11 "github.com/docker/docker/container"
12 "github.com/docker/docker/image"
13 "github.com/google/uuid"
14 "github.com/opencontainers/go-digest"
15 "gotest.tools/v3/assert"
36 t.Helper()
37 var (
38 id = uuid.New().String()
39 computedImageID = digest.FromString(id)
40 cRoot = filepath.Join(root, id)
108 )
110 // moby/moby #37453 - ^ regex not working due to prefix slash
111 // not being stripped
112 containerList, err := d.Containers(&types.ContainerListOptions{
cache.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 242 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 )
36 // define the regex for a UUID once up-front
37 var _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}$")
extension.pb.validate.go (https://github.com/envoyproxy/go-control-plane.git) Go · 219 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 )
36 // define the regex for a UUID once up-front
37 var _extension_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}$")
metric_cluster.go (https://github.com/hashicorp/vault.git) Go · 261 lines
28 Description string `json:"description"` // string
29 MatchingMetrics []string `json:"_matching_metrics,omitempty"` // [] len >= 1 (result info only, if query has extras - cannot be set)
30 MatchingUUIDMetrics map[string][]string `json:"_matching_uuid_metrics,omitempty"` // [] len >= 1 (result info only, if query has extras - cannot be set)
31 Name string `json:"name"` // string
32 Queries []MetricQuery `json:"queries"` // [] len >= 1
47 clusterCID := string(*cid)
49 matched, err := regexp.MatchString(config.MetricClusterCIDRegex, clusterCID)
50 if err != nil {
51 return nil, err
131 clusterCID := string(cfg.CID)
133 matched, err := regexp.MatchString(config.MetricClusterCIDRegex, clusterCID)
134 if err != nil {
135 return nil, err
message_matcher.go (https://gitlab.com/karouf/heka) Go · 245 lines
71 func getStringValue(msg *Message, stmt *Statement) string {
72 switch stmt.field.tokenId {
73 case VAR_UUID:
74 return msg.GetUuidString()
123 return (s >= stmt.value.token)
124 case OP_RE:
125 if stmt.value.regexp != nil {
126 return stmt.value.regexp.MatchString(s)
131 }
132 case OP_NRE:
133 if stmt.value.regexp != nil {
134 return !stmt.value.regexp.MatchString(s)
181 default:
182 switch stmt.field.tokenId {
183 case VAR_UUID, VAR_TYPE, VAR_LOGGER, VAR_PAYLOAD,
184 VAR_ENVVERSION, VAR_HOSTNAME:
185 return stringTest(getStringValue(msg, stmt), stmt)
metadata.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 235 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 )
36 // define the regex for a UUID once up-front
37 var _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}$")
read_through_segment_test.go (https://github.com/m3db/m3.git) Go · 416 lines
95 parsedRegex, err := syntax.Parse(".*this-will-be-slow.*", syntax.Simple)
96 require.NoError(t, err)
97 compiledRegex := index.CompiledRegex{
98 FSTSyntax: parsedRegex,
150 // Make sure it it works with no cache.
151 pl, err := readThrough.MatchRegexp(field, compiledRegex)
152 require.NoError(t, err)
153 require.True(t, pl.Equal(originalPL))
275 segment, cache, defaultReadThroughSegmentOptions)
277 segmentUUID := readThroughSeg.(*ReadThroughSegment).uuid
279 // Store an entry for the segment in the cache so we can check if it
280 // gets purged after.
281 cache.PutRegexp(segmentUUID, "some-field", "some-pattern", roaring.NewPostingsList())
283 segment.EXPECT().Close().Return(nil)
user_event.go (https://github.com/dollarshaveclub/furan.git) Go · 265 lines
3 import (
4 "fmt"
5 "regexp"
7 "github.com/hashicorp/consul/agent/consul/structs"
8 "github.com/hashicorp/go-uuid"
9 )
81 // Format message
82 var err error
83 if params.ID, err = uuid.GenerateUUID(); err != nil {
84 return fmt.Errorf("UUID generation failed: %v", err)
162 }
164 var tagRe *regexp.Regexp
165 if msg.TagFilter != "" {
166 re, err := regexp.Compile(msg.TagFilter)
common.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 314 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 )
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}$")
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 )
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
159 case *Config_KeyValuePair_RegexValueRewrite:
161 if v, ok := interface{}(m.GetRegexValueRewrite()).(interface{ Validate() error }); ok {
types.go (git://github.com/eclark/exl.git) Go · 550 lines
menu.go (https://github.com/GoAdminGroup/go-admin.git) Go · 261 lines
keys.pb.validate.go (https://github.com/TheThingsNetwork/lorawan-stack.git) Go · 376 lines
10 "net/mail"
11 "net/url"
12 "regexp"
13 "strings"
14 "time"
24 _ = fmt.Print
25 _ = utf8.UTFMax
26 _ = (*regexp.Regexp)(nil)
27 _ = (*strings.Reader)(nil)
28 _ = net.IPv4len
33 )
35 // define the regex for a UUID once up-front
36 var _keys_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}$")
module.pb.validate.go (https://github.com/bufbuild/buf.git) Go · 287 lines
25 "net/mail"
26 "net/url"
27 "regexp"
28 "strings"
29 "time"
39 _ = fmt.Print
40 _ = utf8.UTFMax
41 _ = (*regexp.Regexp)(nil)
42 _ = (*strings.Reader)(nil)
43 _ = net.IPv4len
48 )
50 // define the regex for a UUID once up-front
51 var _module_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}$")
alien_controller.go (https://github.com/eyebluecn/tank.git) Go · 351 lines
174 func (this *AlienController) Confirm(writer http.ResponseWriter, request *http.Request) *result.WebResult {
176 matterUuid := request.FormValue("matterUuid")
177 if matterUuid == "" {
263 }
265 user := this.userDao.CheckByUuid(uploadToken.UserUuid)
267 dirMatter := this.matterDao.CheckWithRootByUuid(uploadToken.FolderUuid, user)
313 matter := this.matterDao.CheckByUuid(matterUuid)
314 if matter.UserUuid != user.Uuid {
315 panic(result.BadRequest("matter not belong to you"))
316 }
328 downloadToken := &DownloadToken{
329 UserUuid: user.Uuid,
330 MatterUuid: matterUuid,
path_role_create.go (https://github.com/hashicorp/vault.git) Go · 200 lines
6 "io/ioutil"
8 "github.com/hashicorp/go-uuid"
9 "github.com/hashicorp/vault/sdk/framework"
10 "github.com/hashicorp/vault/sdk/logical"
14 func pathCreds(b *backend) *framework.Path {
15 return &framework.Path{
16 Pattern: "creds/" + framework.GenericNameRegex("name"),
17 Fields: map[string]*framework.FieldSchema{
18 "name": &framework.FieldSchema{
49 // Ensure username is unique
50 uuidVal, err := uuid.GenerateUUID()
51 if err != nil {
52 return nil, err
pools.go (https://github.com/kubernetes/kops.git) Go · 159 lines
22 "net/http"
23 "net/url"
24 "regexp"
26 "github.com/google/uuid"
42 func (m *MockClient) mockPools() {
43 re := regexp.MustCompile(`/lbaas/pools/?`)
45 handler := func(w http.ResponseWriter, r *http.Request) {
139 p := pools.Pool{
140 ID: uuid.New().String(),
141 Name: create.Pool.Name,
142 LBMethod: string(create.Pool.LBMethod),
utils.go (https://github.com/beatlabs/patron.git) Go · 262 lines
ratelimit.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 298 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 )
40 // define the regex for a UUID once up-front
41 var _ratelimit_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}$")
plugin.go (https://github.com/starkandwayne/shield.git) Go · 291 lines
5 "io"
6 "os"
7 "regexp"
8 "strings"
9 "time"
19 func validBucketName(v string) bool {
20 ok, err := regexp.MatchString(`^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$`, v)
21 return ok && err == nil
22 }
279 year, mon, day := t.Date()
280 hour, min, sec := t.Clock()
281 uuid := plugin.GenUUID()
282 path := fmt.Sprintf("%s/%04d/%02d/%02d/%04d-%02d-%02d-%02d%02d%02d-%s", e.PathPrefix, year, mon, day, year, mon, day, hour, min, sec, uuid)
adaptive_concurrency.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 517 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 )
36 // define the regex for a UUID once up-front
37 var _adaptive_concurrency_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}$")
regexes.go (https://github.com/alipay/sofa-mesh.git) Go · 59 lines
39 hexcolorRegex = regexp.MustCompile(hexcolorRegexString)
40 rgbRegex = regexp.MustCompile(rgbRegexString)
41 rgbaRegex = regexp.MustCompile(rgbaRegexString)
44 emailRegex = regexp.MustCompile(emailRegexString)
45 base64Regex = regexp.MustCompile(base64RegexString)
46 iSBN10Regex = regexp.MustCompile(iSBN10RegexString)
47 iSBN13Regex = regexp.MustCompile(iSBN13RegexString)
48 uUID3Regex = regexp.MustCompile(uUID3RegexString)
49 uUID4Regex = regexp.MustCompile(uUID4RegexString)
50 uUID5Regex = regexp.MustCompile(uUID5RegexString)
51 uUIDRegex = regexp.MustCompile(uUIDRegexString)
52 aSCIIRegex = regexp.MustCompile(aSCIIRegexString)
53 printableASCIIRegex = regexp.MustCompile(printableASCIIRegexString)
54 multibyteRegex = regexp.MustCompile(multibyteRegexString)
datamgmtsrv.go (https://github.com/anshumanbh/Amass.git) Go · 427 lines
106 for _, handler := range dms.Handlers {
107 err := handler.Insert(&handlers.DataOptsParams{
108 UUID: dms.Config().UUID.String(),
109 Timestamp: time.Now().Format(time.RFC3339),
110 Type: handlers.OptDomain,
137 for _, handler := range dms.Handlers {
138 err := handler.Insert(&handlers.DataOptsParams{
139 UUID: dms.Config().UUID.String(),
140 Timestamp: time.Now().Format(time.RFC3339),
141 Type: handlers.OptCNAME,
166 for _, handler := range dms.Handlers {
167 err := handler.Insert(&handlers.DataOptsParams{
168 UUID: dms.Config().UUID.String(),
169 Timestamp: time.Now().Format(time.RFC3339),
170 Type: handlers.OptA,
file.pb.validate.go (https://github.com/XiaoMi/naftis.git) Go · 140 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 )
36 // define the regex for a UUID once up-front
37 var _file_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}$")
funcs_test.go (https://github.com/underarmour/libra.git) Go · 271 lines
3 import (
4 "fmt"
5 "regexp"
6 "testing"
7 )
255 }
257 func TestGenerateUUID(t *testing.T) {
258 prev := GenerateUUID()
259 for i := 0; i < 100; i++ {
260 id := GenerateUUID()
261 if prev == id {
262 t.Fatalf("Should get a new ID!")
263 }
265 matched, err := regexp.MatchString(
266 "[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}", id)
267 if !matched || err != nil {
legacy_deployment_state_migrator.go (https://gitlab.com/JamesClonk/bosh-init) Go · 168 lines
10 biproperty "github.com/cloudfoundry/bosh-init/internal/github.com/cloudfoundry/bosh-utils/property"
11 boshsys "github.com/cloudfoundry/bosh-init/internal/github.com/cloudfoundry/bosh-utils/system"
12 boshuuid "github.com/cloudfoundry/bosh-init/internal/github.com/cloudfoundry/bosh-utils/uuid"
13 )
20 deploymentStateService DeploymentStateService
21 fs boshsys.FileSystem
22 uuidGenerator boshuuid.Generator
23 logger boshlog.Logger
24 logTag string
88 deploymentState.DirectorID = legacyDeploymentState.Instances[0].UUID
89 } else {
90 uuid, err := m.uuidGenerator.Generate()
91 if err != nil {
92 return deploymentState, bosherr.WrapError(err, "Generating UUID")
custom_tag.pb.validate.go (https://github.com/alipay/sofa-mosn.git) Go · 479 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 )
36 // define the regex for a UUID once up-front
37 var _custom_tag_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}$")
transcoder.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 221 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 )
36 // define the regex for a UUID once up-front
37 var _transcoder_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}$")
meta_data_types.go (https://github.com/kitech/qt.go.git) Go · 156 lines
36 const _QMetaType__QPoint = 25
37 const _QMetaType__QPointF = 26
38 const _QMetaType__QRegExp = 27
39 const _QMetaType__QEasingCurve = 29
40 const _QMetaType__QUuid = 30
114 _QMetaType__QPoint: "QMetaType::QPoint",
115 _QMetaType__QPointF: "QMetaType::QPointF",
116 _QMetaType__QRegExp: "QMetaType::QRegExp",
117 _QMetaType__QEasingCurve: "QMetaType::QEasingCurve",
118 _QMetaType__QUuid: "QMetaType::QUuid",
http_tracer.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 199 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 )
36 // define the regex for a UUID once up-front
37 var _http_tracer_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}$")
udp_listener_config.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 189 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 )
36 // define the regex for a UUID once up-front
37 var _udp_listener_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}$")
camel_case.go (https://github.com/foxiswho/echo-go.git) Go · 145 lines
91 "UI": true,
92 "UID": true,
93 "UUID": true,
94 "URI": true,
95 "URL": true,
130 func LittleCamelCase(str string) string {
131 //str = LintGonicMapper.Table2Obj(str)
132 //reg := regexp.MustCompile(`^\w{1}`)
133 //return reg.ReplaceAllStringFunc(str, func(s string) string {
134 // return strings.ToUpper(s)
custom_tag.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 488 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 )
36 // define the regex for a UUID once up-front
37 var _custom_tag_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}$")
334 return CustomTag_HeaderValidationError{
335 field: "Name",
336 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
337 }
338 }
tap.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 280 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 )
36 // define the regex for a UUID once up-front
37 var _tap_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}$")
server_info.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 286 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 )
36 // define the regex for a UUID once up-front
37 var _server_info_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}$")
csds.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 422 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 )
36 // define the regex for a UUID once up-front
37 var _csds_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}$")
field_validator.go (https://github.com/goodrain/rainbond.git) Go · 552 lines
47 "numeric_between": "NumericBetween",
48 "url": "ValidateURL",
49 "uuid": "UUID",
50 "uuid_v3": "UUID3",
51 "uuid_v4": "UUID4",
52 "uuid_v5": "UUID5",
80 }
82 // Regex check the custom Regex rules
83 // Regex:^[a-zA-Z]+$ means this field can only contain alphabet (a-z and A-Z)
504 }
506 // UUID check if provided field contains valid UUID
507 func (v *fieldValidator) UUID() {
sysinfo.go (https://gitlab.com/unofficial-mirrors/kubernetes) Go · 203 lines
17 import (
18 "fmt"
19 "regexp"
20 "strconv"
21 "strings"
25 )
27 var schedulerRegExp = regexp.MustCompile(`.*\[(.*)\].*`)
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])
auth.go (https://github.com/brocaar/chirpstack-application-server.git) Go · 192 lines
16 )
18 var validAuthorizationRegexp = regexp.MustCompile(`(?i)^bearer (.*)$`)
20 // Claims defines the struct containing the token claims.
30 // APIKeyID defines the API key ID.
31 APIKeyID uuid.UUID `json:"api_key_id"`
32 }
51 // GetAPIKey returns the API key ID.
52 GetAPIKeyID(context.Context) (uuid.UUID, error)
53 }
topology.pb.validate.go (https://github.com/lyft/clutch.git) Go · 196 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 )
36 // define the regex for a UUID once up-front
37 var _topology_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}$")
mux_test.go (https://github.com/peer-calls/peer-calls.git) Go · 192 lines
6 "net/http"
7 "net/http/httptest"
8 "regexp"
9 "strings"
10 "testing"
71 require.Equal(t, 200, w.Code)
72 require.Regexp(t, "action=\"/test/call\"", w.Body.String())
73 }
116 uuid := "[0-9a-z-A-Z]+$"
117 require.Equal(t, 302, w.Code, "expected 302 redirect")
118 require.Regexp(t, "/test/call/"+uuid, w.Header().Get("Location"))
119 }
overload.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 508 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 )
36 // define the regex for a UUID once up-front
37 var _overload_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}$")
fault.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 347 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 )
36 // define the regex for a UUID once up-front
37 var _fault_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}$")
certs.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 400 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 )
36 // define the regex for a UUID once up-front
37 var _certs_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}$")
user_event.go (https://github.com/backstage/backstage.git) Go · 265 lines
3 import (
4 "fmt"
5 "regexp"
7 "github.com/hashicorp/consul/consul/structs"
8 "github.com/hashicorp/go-uuid"
9 )
81 // Format message
82 var err error
83 if params.ID, err = uuid.GenerateUUID(); err != nil {
84 return fmt.Errorf("UUID generation failed: %v", err)
162 }
164 var tagRe *regexp.Regexp
165 if msg.TagFilter != "" {
166 re, err := regexp.Compile(msg.TagFilter)
node.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 127 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 )
36 // define the regex for a UUID once up-front
37 var _node_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}$")
file_based_metadata.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 118 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 )
36 // define the regex for a UUID once up-front
37 var _file_based_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}$")
zookeeper_proxy.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 121 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 )
36 // define the regex for a UUID once up-front
37 var _zookeeper_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}$")
socket_option.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 131 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 )
36 // define the regex for a UUID once up-front
37 var _socket_option_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}$")
sessions.go (https://github.com/starkandwayne/shield.git) Go · 236 lines
11 type Session struct {
12 UUID string `json:"uuid"`
13 UserUUID string `json:"user_uuid"`
73 return `
74 SELECT s.uuid, s.user_uuid, s.created_at, s.last_seen, s.token, s.name, s.ip_addr, s.user_agent, u.account, u.backend
75 FROM sessions s
76 INNER JOIN users u ON u.uuid = s.user_uuid
170 FROM sessions s
171 INNER JOIN users u ON u.uuid = s.user_uuid
172 WHERE s.uuid = ?`, id)
226 UPDATE sessions SET last_seen = ?, user_uuid = ?, ip_addr = ?, user_agent = ?
227 WHERE uuid = ?`, time.Now().Unix(), session.UserUUID, session.IP, session.UserAgent, session.UUID)
228 }
grpc_method_list.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 198 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 )
36 // define the regex for a UUID once up-front
37 var _grpc_method_list_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}$")
uuid_test.go (https://gitlab.com/aviz/go-uuid) Go · 158 lines
1 // This package provides immutable UUID structs and the functions
2 // NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4
3 // and 5 UUIDs as specified in RFC 4122.
4 //
5 // Copyright (C) 2011 by Krzysztof Kowalik <chris@nu7hat.ch>
6 package uuid
8 import (
9 "fmt"
10 "regexp"
11 "testing"
12 )
17 _, err := Parse([]byte{1, 2, 3, 4, 5})
18 if err == nil {
19 t.Errorf("Expected error due to invalid UUID sequence")
20 }
21 base, _ := NewV4()
gatt_tool.go (https://gitlab.com/brucealdridge/driver-go-blecombined) Go · 162 lines
10 "fmt"
11 "os/exec"
12 "regexp"
13 "strings"
19 var (
20 log = loggo.GetLogger("bluez")
21 charRegex = regexp.MustCompile("handle = (?P<handle>[0-9a-fx]+), char properties = (?P<char_props>[0-9a-fx]+), char value handle = (?P<char_value_handle>[0-9a-fx]+), uuid = (?P<uuid>[0-9a-f-]+)")
22 readRegex = regexp.MustCompile(`Characteristic value\/descriptor: ([0-9a-f ]+)`)
39 // Characteristic holds the attributes needed to address a characteristic via the api.
40 type Characteristic struct {
41 UUID string
42 Handle string // use this to READ
43 CharValueHandle string // use this to WRITE
62 c := &Characteristic{
63 UUID: params["uuid"],
64 Handle: params["handle"],
65 CharValueHandle: params["char_value_handle"],
listeners.pb.validate.go (https://github.com/datawire/ambassador.git) Go · 193 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 )
36 // define the regex for a UUID once up-front
37 var _listeners_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}$")
event.go (https://github.com/pydio/cells.git) Go · 120 lines
6 "net/http"
7 "path"
8 "regexp"
9 "strings"
10 "time"
13 proto "github.com/micro/go-api/proto"
14 "github.com/micro/util/go/lib/ctx"
15 "github.com/pborman/uuid"
16 )
72 Name: action,
73 // TODO: dedupe event
74 Id: fmt.Sprintf("%s-%s-%s", topic, action, uuid.NewUUID().String()),
75 Header: make(map[string]*proto.Pair),
76 Timestamp: time.Now().Unix(),
autohotkey.vim (https://bitbucket.org/ultra_iter/vim-qt.git) Vim Script · 292 lines
strindex.xml (git://pkgs.fedoraproject.org/scilab) XML · 135 lines
web.xd.js (http://aipo.googlecode.com/svn/) JavaScript · 94 lines
41 // flags in regexp.tld can be applied.
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.
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.
72 var re = new RegExp("^" + dojox.regexp.emailAddressList(flags) + "$", "i");
73 return re.test(value); // Boolean
74 }