PageRenderTime 66ms queryTime 36ms sortTime 0ms getByIdsTime 116ms findMatchingLines 112ms

100+ results results for 'regex uuid lang:go' (66 ms)

Not the results you expected?
rfc4122_test.go https://gitlab.com/github-cloud-corp/amazon-ssm-agent | Go | 209 lines
                    
29	}
                    
30	if !parseUUIDRegex.MatchString(u.String()) {
                    
31		t.Errorf("Expected string representation to be valid, given: %s", u.String())
                    
49	}
                    
50	if !parseUUIDRegex.MatchString(u.String()) {
                    
51		t.Errorf("Expected string representation to be valid, given: %s", u.String())
                    
69	if Equal(u4, u) {
                    
70		t.Errorf("Expected UUIDs generated with the same namespace and different names to be different but got: %s and %s", u4, u)
                    
71	}
                    
97	}
                    
98	if !parseUUIDRegex.MatchString(u.String()) {
                    
99		t.Errorf("Expected string representation to be valid, given: %s", u.String())
                    
117	}
                    
118	if !parseUUIDRegex.MatchString(u.String()) {
                    
119		t.Errorf("Expected string representation to be valid, given: %s", u.String())
                    
                
host_path.go https://gitlab.com/CORP-RESELLER/kubernetes | Go | 325 lines
                    
21	"os"
                    
22	"regexp"
                    
23
                    
25	"k8s.io/kubernetes/pkg/types"
                    
26	"k8s.io/kubernetes/pkg/util/uuid"
                    
27	"k8s.io/kubernetes/pkg/volume"
                    
264func (r *hostPathProvisioner) Provision() (*api.PersistentVolume, error) {
                    
265	fullpath := fmt.Sprintf("/tmp/hostpath_pv/%s", uuid.NewUUID())
                    
266
                    
307func (r *hostPathDeleter) Delete() error {
                    
308	regexp := regexp.MustCompile("/tmp/.+")
                    
309	if !regexp.MatchString(r.GetPath()) {
                    
                
results.go https://gitlab.com/vectorci/kubernetes | Go | 316 lines
                    
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"`
                    
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"`
                    
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"`
                    
                
sandbox_decoder.go https://gitlab.com/wilane/heka | Go | 383 lines
                    
22	"path/filepath"
                    
23	"regexp"
                    
24	"sync"
                    
32	"github.com/mozilla-services/heka/sandbox/lua"
                    
33	"github.com/pborman/uuid"
                    
34)
                    
60func (s *SandboxDecoder) SetName(name string) {
                    
61	re := regexp.MustCompile("\\W")
                    
62	s.name = re.ReplaceAllString(name, "_")
                    
225			if s.pack.Message.Uuid == nil {
                    
226				s.pack.Message.SetUuid(uuid.NewRandom()) // UUID should always be unique
                    
227				s.pack.TrustMsgBytes = false
                    
                
validation.go https://gitlab.com/unofficial-mirrors/openshift-origin | Go | 163 lines
                    
4	"fmt"
                    
5	"regexp"
                    
6
                    
14
                    
15var ParameterNameRegexp = regexp.MustCompile(`^[a-zA-Z0-9_]+$`)
                    
16
                    
22	}
                    
23	if !ParameterNameRegexp.MatchString(param.Name) {
                    
24		allErrs = append(allErrs, field.Invalid(fldPath.Child("name"), param.Name, fmt.Sprintf("does not match %v", ParameterNameRegexp)))
                    
129
                    
130var uuidRegex = regexp.MustCompile("^(?i)[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
                    
131
                    
132func nameIsUUID(name string, prefix bool) []string {
                    
133	if uuidRegex.MatchString(name) {
                    
134		return nil
                    
                
openstack.go https://gitlab.com/github-cloud-corporation/kubernetes | Go | 443 lines
                    
25	"net/http"
                    
26	"regexp"
                    
27	"strings"
                    
153
                    
154// parseMetadataUUID reads JSON from OpenStack metadata server and parses
                    
155// instance ID out of it.
                    
156func parseMetadataUUID(jsonData []byte) (string, error) {
                    
157	// We should receive an object with { 'uuid': '<uuid>' } and couple of other
                    
158	// properties (which we ignore).
                    
159
                    
160	obj := struct{ UUID string }{}
                    
161	err := json.Unmarshal(jsonData, &obj)
                    
165
                    
166	uuid := obj.UUID
                    
167	if uuid == "" {
                    
                
operators_test.go https://bitbucket.org/asardak/atm-store.git | Go | 231 lines
                    
69		{"NotIn", NotIn(f("name"), "Joe", "Jane"), 1},
                    
70		{"MatchRegexCase upper", MatchRegexCase(f("name"), "J.*"), 2},
                    
71		{"MatchRegexCase lower", MatchRegexCase(f("name"), "j.*"), 0},
                    
71		{"MatchRegexCase lower", MatchRegexCase(f("name"), "j.*"), 0},
                    
72		{"MatchRegex upper", MatchRegex(f("name"), "J.*"), 2},
                    
73		{"MatchRegex lower", 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},
                    
75		{"NotMatchRegexCase lower", NotMatchRegexCase(f("name"), "j.*"), 3},
                    
76		{"NotMatchRegex upper", NotMatchRegex(f("name"), "J.*"), 1},
                    
77		{"NotMatchRegex lower", NotMatchRegex(f("name"), "j.*"), 1},
                    
93	s.create(`CREATE TABLE slices (
                    
94		id uuid PRIMARY KEY,
                    
95		elems bigint[]
                    
                
gatt_tool_test.go https://gitlab.com/brucealdridge/driver-go-blecombined | Go | 42 lines
                    
11
                    
12func 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	}
                    
                
utils.go https://gitlab.com/prima101112/test-quiz | Go | 264 lines
                    
7	"reflect"
                    
8	"regexp"
                    
9	"runtime"
                    
25// Copied from golint
                    
26var commonInitialisms = []string{"API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "LHS", "QPS", "RAM", "RHS", "RPC", "SLA", "SMTP", "SSH", "TLS", "TTL", "UI", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XSRF", "XSS"}
                    
27var commonInitialismsReplacer *strings.Replacer
                    
173		_, file, line, ok := runtime.Caller(i)
                    
174		if ok && (!regexp.MustCompile(`jinzhu/gorm/.*.go`).MatchString(file) || regexp.MustCompile(`jinzhu/gorm/.*test.go`).MatchString(file)) {
                    
175			return fmt.Sprintf("%v:%v", file, line)
                    
                
pods.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 241 lines
                    
22	"net/http"
                    
23	"regexp"
                    
24	"strconv"
                    
30	"k8s.io/apimachinery/pkg/labels"
                    
31	"k8s.io/apimachinery/pkg/util/uuid"
                    
32	"k8s.io/apimachinery/pkg/util/wait"
                    
51			By("creating the pod")
                    
52			name := "pod-submit-remove-" + string(uuid.NewUUID())
                    
53			value := strconv.Itoa(time.Now().Nanosecond())
                    
123			output := string(buf[:n])
                    
124			proxyRegexp := regexp.MustCompile("Starting to serve on 127.0.0.1:([0-9]+)")
                    
125			match := proxyRegexp.FindStringSubmatch(output)
                    
203			By("creating the pod")
                    
204			name := "pod-qos-class-" + string(uuid.NewUUID())
                    
205			pod := &v1.Pod{
                    
                
utils.go https://gitlab.com/0072016/0072016-docker | Go | 352 lines
                    
8	"os/exec"
                    
9	"regexp"
                    
10	"runtime"
                    
13
                    
14	"github.com/pborman/uuid"
                    
15)
                    
40
                    
41	id := uuid.New()
                    
42	joinedArgs := strings.Join(cmd.Args, " ")
                    
190// matches (+1) or (-1)
                    
191var referenceCountRegex = regexp.MustCompile("\\(([+-]\\d+?)\\)")
                    
192
                    
193func parseReferenceCount(field string) (int, error) {
                    
194	matches := referenceCountRegex.FindStringSubmatch(field)
                    
195	if matches == nil {
                    
                
host_path_test.go https://gitlab.com/0072016/Facebook-php | Go | 273 lines
                    
92func TestDeleter(t *testing.T) {
                    
93	// Deleter has a hard-coded regex for "/tmp".
                    
94	tempPath := fmt.Sprintf("/tmp/hostpath/%s", util.NewUUID())
                    
150func TestProvisioner(t *testing.T) {
                    
151	tempPath := fmt.Sprintf("/tmp/hostpath/%s", util.NewUUID())
                    
152	defer os.RemoveAll(tempPath)
                    
                
prepared_query.go https://github.com/backstage/backstage.git | Go | 353 lines
                    
4	"fmt"
                    
5	"regexp"
                    
6
                    
11
                    
12// validUUID is used to check if a given string looks like a UUID
                    
13var validUUID = regexp.MustCompile(`(?i)^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$`)
                    
14
                    
15// isUUID returns true if the given string is a valid UUID.
                    
16func isUUID(str string) bool {
                    
16func isUUID(str string) bool {
                    
17	return validUUID.MatchString(str)
                    
18}
                    
148	// queries from ever making it into the state store. Note that we have
                    
149	// to see if the name looks like a UUID before checking since the UUID
                    
150	// index will complain if we look up something that's not formatted
                    
                
utils.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 210 lines
                    
21	"path/filepath"
                    
22	"regexp"
                    
23	"strings"
                    
53
                    
54// formatVirtualDiskUUID removes any spaces and hyphens in UUID
                    
55// Example UUID input is 42375390-71f9-43a3-a770-56803bcd7baa and output after format is 4237539071f943a3a77056803bcd7baa
                    
55// Example UUID input is 42375390-71f9-43a3-a770-56803bcd7baa and output after format is 4237539071f943a3a77056803bcd7baa
                    
56func formatVirtualDiskUUID(uuid string) string {
                    
57	uuidwithNoSpace := strings.Replace(uuid, " ", "", -1)
                    
57	uuidwithNoSpace := strings.Replace(uuid, " ", "", -1)
                    
58	uuidWithNoHypens := strings.Replace(uuidwithNoSpace, "-", "", -1)
                    
59	return strings.ToLower(uuidWithNoHypens)
                    
159
                    
160//IsValidUUID checks if the string is a valid UUID.
                    
161func IsValidUUID(uuid string) bool {
                    
                
control.go https://gitlab.com/zyfran/gitlab-ci-multi-runner | Go | 243 lines
                    
12	"os/exec"
                    
13	"regexp"
                    
14	"runtime"
                    
73
                    
74	versionRe := regexp.MustCompile(`prlctl version (\d+\.\d+.\d+)`)
                    
75	matches := versionRe.FindStringSubmatch(string(out))
                    
117			snapshot = strings.TrimSpace(snapshot)
                    
118			if len(snapshot) > 0 { // It uses UUID so it should be 38
                    
119				return snapshot, nil
                    
193	stdoutString := strings.TrimSpace(output)
                    
194	re := regexp.MustCompile("net0.* mac=([0-9A-F]{12}) card=.*")
                    
195	macMatch := re.FindAllStringSubmatch(stdoutString, 1)
                    
222
                    
223	re := regexp.MustCompile("(.*)=\"(.*),(.*)," + strings.ToLower(mac) + ",.*\"")
                    
224	mostRecentIP := ""
                    
                
host_path_test.go https://gitlab.com/admin-github-cloud/kubernetes | Go | 275 lines
                    
30	"k8s.io/kubernetes/pkg/util"
                    
31	"k8s.io/kubernetes/pkg/util/uuid"
                    
32	"k8s.io/kubernetes/pkg/volume"
                    
94	// Deleter has a hard-coded regex for "/tmp".
                    
95	tempPath := fmt.Sprintf("/tmp/hostpath/%s", uuid.NewUUID())
                    
96	defer os.RemoveAll(tempPath)
                    
151func TestProvisioner(t *testing.T) {
                    
152	tempPath := fmt.Sprintf("/tmp/hostpath/%s", uuid.NewUUID())
                    
153	defer os.RemoveAll(tempPath)
                    
                
config.go https://gitlab.com/zanderwong/lantern | Go | 374 lines
                    
9	"path/filepath"
                    
10	"regexp"
                    
11	"sort"
                    
13
                    
14	"code.google.com/p/go-uuid/uuid"
                    
15
                    
38	m   *yamlconf.Manager
                    
39	r   = regexp.MustCompile("\\d+\\.\\d+")
                    
40)
                    
333		// MACs is trivially mapped, especially since the salt would be known
                    
334		cfg.Client.DeviceID = base64.StdEncoding.EncodeToString(uuid.NodeID())
                    
335	}
                    
                
batch_controller.go https://gitlab.com/achedeuzot/fhir | Go | 326 lines
                    
7	"reflect"
                    
8	"regexp"
                    
9	"sort"
                    
94			// We need to process conditionals referencing temp IDs in a second pass, so skip them here
                    
95			if strings.Contains(entry.Request.Url, "urn:uuid:") {
                    
96				continue
                    
110		if entry.Request.Method == "PUT" && isConditional(entry) {
                    
111			// Use a regex to swap out the temp IDs with the new IDs
                    
112			for oldID, ref := range refMap {
                    
112			for oldID, ref := range refMap {
                    
113				re := regexp.MustCompile("([=,])" + oldID + "(&|,|$)")
                    
114				entry.Request.Url = re.ReplaceAllString(entry.Request.Url, "${1}"+ref.Reference+"${2}")
                    
116
                    
117			if strings.Contains(entry.Request.Url, "urn:uuid:") {
                    
118				c.AbortWithError(http.StatusNotImplemented,
                    
                
format_checkers.go https://bitbucket.org/RusAlex/cryptocoins.git | Go | 250 lines
                    
62
                    
63	// UUIDFormatChecker validates a UUID is in the correct format
                    
64	UUIDFormatChecker struct{}
                    
65
                    
66	// RegexFormatChecker validates a regex is in the correct format
                    
67	RegexFormatChecker struct{}
                    
81			"uri-reference": URIReferenceFormatChecker{},
                    
82			"uuid":      	 UUIDFormatChecker{},
                    
83			"regex":     	 RegexFormatChecker{},
                    
87	// Regex credit: https://github.com/asaskevich/govalidator
                    
88	rxEmail = regexp.MustCompile("^(((([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+(\\.([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|\\.|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.)+(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|\\.|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.?$")
                    
89
                    
92
                    
93	rxUUID = regexp.MustCompile("^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$")
                    
94)
                    
                
backend_test.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 158 lines
                    
21	"reflect"
                    
22	"regexp"
                    
23	"testing"
                    
25
                    
26	"github.com/pborman/uuid"
                    
27
                    
47			&auditinternal.Event{
                    
48				AuditID: types.UID(uuid.NewRandom().String()),
                    
49			},
                    
61				RequestReceivedTimestamp: metav1.NewMicroTime(time.Now()),
                    
62				AuditID:                  types.UID(uuid.NewRandom().String()),
                    
63				Stage:                    auditinternal.StageRequestReceived,
                    
79			&auditinternal.Event{
                    
80				AuditID: types.UID(uuid.NewRandom().String()),
                    
81				Level:   auditinternal.LevelMetadata,
                    
                
checks_test.go https://gitlab.com/gitlab-org/gitaly | Go | 554 lines
                    
14
                    
15	"github.com/google/uuid"
                    
16	"github.com/stretchr/testify/assert"
                    
218			if tc.expectErr {
                    
219				assert.Regexp(t, "^the following nodes are not healthy: .+", err)
                    
220				return
                    
369			setup: func(t *testing.T, db testdb.DB) config.DB {
                    
370				role := "praefect_ro_role_" + strings.ReplaceAll(uuid.New().String(), "-", "")
                    
371
                    
                
upnp.go https://gitlab.com/shinvdu/syncthing | Go | 440 lines
                    
22	"net/url"
                    
23	"regexp"
                    
24	"runtime"
                    
92			if existingResult.ID() == result.ID() {
                    
93				l.Debugf("Skipping duplicate result %s with services:", result.uuid)
                    
94				for _, service := range result.services {
                    
203
                    
204	deviceUUID := strings.TrimPrefix(strings.Split(deviceUSN, "::")[0], "uuid:")
                    
205	matched, err := regexp.MatchString("[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", deviceUUID)
                    
206	if !matched {
                    
207		l.Infoln("Invalid IGD response: invalid device UUID", deviceUUID, "(continuing anyway)")
                    
208	}
                    
240	return IGD{
                    
241		uuid:           deviceUUID,
                    
242		friendlyName:   upnpRoot.Device.FriendlyName,
                    
                
handler.go https://gitlab.com/0072016/docker-registry | Go | 235 lines
                    
9	"path/filepath"
                    
10	"regexp"
                    
11	"time"
                    
15	Method  string
                    
16	Regexp  *regexp.Regexp
                    
17	Handler func(http.ResponseWriter, *http.Request, [][]string)
                    
19
                    
20func GenerateUUID() string {
                    
21	f, _ := os.Open("/dev/urandom")
                    
185	}
                    
186	h.Mappings = append(h.Mappings, &Mapping{t, regexp.MustCompile("/v(\\d+)/" + re), f})
                    
187}
                    
203	started := time.Now()
                    
204	uuid := GenerateUUID()
                    
205	w.Header().Add("X-Request-ID", uuid)
                    
                
list_test.go https://github.com/dotcloud/docker.git | Go | 144 lines
                    
12	"github.com/docker/docker/image"
                    
13	"github.com/google/uuid"
                    
14	"github.com/opencontainers/go-digest"
                    
37	var (
                    
38		id              = uuid.New().String()
                    
39		computedImageID = digest.FromString(id)
                    
109
                    
110	// moby/moby #37453 - ^ regex not working due to prefix slash
                    
111	// not being stripped
                    
                
regexes.go https://gitlab.com/nidhomriza/handbook-tes | Go | 97 lines
                    
70	iSBN13Regex                = regexp.MustCompile(iSBN13RegexString)
                    
71	uUID3Regex                 = regexp.MustCompile(uUID3RegexString)
                    
72	uUID4Regex                 = regexp.MustCompile(uUID4RegexString)
                    
72	uUID4Regex                 = regexp.MustCompile(uUID4RegexString)
                    
73	uUID5Regex                 = regexp.MustCompile(uUID5RegexString)
                    
74	uUIDRegex                  = regexp.MustCompile(uUIDRegexString)
                    
74	uUIDRegex                  = regexp.MustCompile(uUIDRegexString)
                    
75	uUID3RFC4122Regex          = regexp.MustCompile(uUID3RFC4122RegexString)
                    
76	uUID4RFC4122Regex          = regexp.MustCompile(uUID4RFC4122RegexString)
                    
77	uUID5RFC4122Regex          = regexp.MustCompile(uUID5RFC4122RegexString)
                    
78	uUIDRFC4122Regex           = regexp.MustCompile(uUIDRFC4122RegexString)
                    
79	aSCIIRegex                 = regexp.MustCompile(aSCIIRegexString)
                    
85	sSNRegex                   = regexp.MustCompile(sSNRegexString)
                    
86	hostnameRegexRFC952        = regexp.MustCompile(hostnameRegexStringRFC952)
                    
87	hostnameRegexRFC1123       = regexp.MustCompile(hostnameRegexStringRFC1123)
                    
                
patterns.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 83 lines
                    
13	UUID5          string = "^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
                    
14	UUID           string = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                    
15	Alpha          string = "^[a-zA-Z]+$"
                    
52	rxEmail          = regexp.MustCompile(Email)
                    
53	rxCreditCard     = regexp.MustCompile(CreditCard)
                    
54	rxISBN10         = regexp.MustCompile(ISBN10)
                    
55	rxISBN13         = regexp.MustCompile(ISBN13)
                    
56	rxUUID3          = regexp.MustCompile(UUID3)
                    
57	rxUUID4          = regexp.MustCompile(UUID4)
                    
58	rxUUID5          = regexp.MustCompile(UUID5)
                    
59	rxUUID           = regexp.MustCompile(UUID)
                    
60	rxAlpha          = regexp.MustCompile(Alpha)
                    
64	rxFloat          = regexp.MustCompile(Float)
                    
65	rxHexadecimal    = regexp.MustCompile(Hexadecimal)
                    
66	rxHexcolor       = regexp.MustCompile(Hexcolor)
                    
                
message_matcher.go https://gitlab.com/karouf/heka | Go | 245 lines
                    
72	switch stmt.field.tokenId {
                    
73	case VAR_UUID:
                    
74		return msg.GetUuidString()
                    
124	case OP_RE:
                    
125		if stmt.value.regexp != nil {
                    
126			return stmt.value.regexp.MatchString(s)
                    
132	case OP_NRE:
                    
133		if stmt.value.regexp != nil {
                    
134			return !stmt.value.regexp.MatchString(s)
                    
182		switch stmt.field.tokenId {
                    
183		case VAR_UUID, VAR_TYPE, VAR_LOGGER, VAR_PAYLOAD,
                    
184			VAR_ENVVERSION, VAR_HOSTNAME:
                    
                
types.go git://github.com/eclark/exl.git | Go | 550 lines
                    
29	NullType
                    
30	RegexType
                    
31	dbPointerType
                    
47	OldBinaryType
                    
48	UUIDType
                    
49	MD5Type  BinSubtype = 5
                    
340
                    
341type Regex struct {
                    
342	Pattern string
                    
345
                    
346func (re *Regex) WriteTo(w io.Writer) (n int64, err os.Error) {
                    
347	return write(w, []byte(re.Pattern), byte(0), []byte(re.Options), byte(0))
                    
349
                    
350func (re *Regex) ReadFrom(r io.Reader) (n int64, err os.Error) {
                    
351	var v byte
                    
                
control.go https://gitlab.com/panzm/gitlab-ci-multi-runner | Go | 276 lines
                    
10	"os/exec"
                    
11	"regexp"
                    
12	"strings"
                    
107	}
                    
108	portRe := regexp.MustCompile(`guestssh.*host port = (\d+)`)
                    
109	sshPort := portRe.FindStringSubmatch(info)
                    
148	}
                    
149	allPortsRe := regexp.MustCompile(`host port = (\d+)`)
                    
150	usedPorts = allPortsRe.FindAllStringSubmatch(output, -1)
                    
208	}
                    
209	snapshotRe := regexp.MustCompile(fmt.Sprintf(`(?m)^Snapshot(Name|UUID)[^=]*="%s"$`, regexp.QuoteMeta(snapshotName)))
                    
210	snapshot := snapshotRe.FindStringSubmatch(output)
                    
218	}
                    
219	snapshotRe := regexp.MustCompile(`(?m)^CurrentSnapshotName="([^"]*)"$`)
                    
220	snapshot := snapshotRe.FindStringSubmatch(output)
                    
                
legacy_deployment_state_migrator.go https://gitlab.com/JamesClonk/bosh-init | Go | 168 lines
                    
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)
                    
21	fs                     boshsys.FileSystem
                    
22	uuidGenerator          boshuuid.Generator
                    
23	logger                 boshlog.Logger
                    
29	fs boshsys.FileSystem,
                    
30	uuidGenerator boshuuid.Generator,
                    
31	logger boshlog.Logger,
                    
35		fs:            fs,
                    
36		uuidGenerator: uuidGenerator,
                    
37		logger:        logger,
                    
89	} else {
                    
90		uuid, err := m.uuidGenerator.Generate()
                    
91		if err != nil {
                    
                
password.go https://gitlab.com/e0/harbor | Go | 201 lines
                    
105			URL:  harborURL,
                    
106			UUID: uuid,
                    
107		})
                    
147
                    
148	resetUUID := rpc.GetString("reset_uuid")
                    
149	if resetUUID == "" {
                    
162	if user != nil {
                    
163		rpc.Data["ResetUuid"] = user.ResetUUID
                    
164		rpc.ForwardTo("page_title_reset_password", "reset-password")
                    
172
                    
173	resetUUID := cc.GetString("reset_uuid")
                    
174	if resetUUID == "" {
                    
177
                    
178	queryUser := models.User{ResetUUID: resetUUID}
                    
179	user, err := dao.GetUser(queryUser)
                    
                
sysinfo.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 203 lines
                    
18	"fmt"
                    
19	"regexp"
                    
20	"strconv"
                    
26
                    
27var schedulerRegExp = regexp.MustCompile(`.*\[(.*)\].*`)
                    
28
                    
70		if err == nil {
                    
71			matches := schedulerRegExp.FindSubmatch([]byte(blkSched))
                    
72			if len(matches) >= 2 {
                    
200
                    
201func GetSystemUUID(sysFs sysfs.SysFs) (string, error) {
                    
202	return sysFs.GetSystemUUID()
                    
                
device_plugin.go https://bitbucket.org/Jake-Qu/kubernetes-mirror.git | Go | 314 lines
                    
24
                    
25	"regexp"
                    
26
                    
28	"k8s.io/apimachinery/pkg/api/resource"
                    
29	"k8s.io/apimachinery/pkg/util/uuid"
                    
30
                    
199func makeBusyboxPod(resourceName, cmd string) *v1.Pod {
                    
200	podName := "device-plugin-test-" + string(uuid.NewUUID())
                    
201	rl := v1.ResourceList{v1.ResourceName(resourceName): *resource.NewQuantity(1, resource.DecimalSI)}
                    
248	framework.Logf("got pod logs: %v", logs)
                    
249	regex := regexp.MustCompile(re)
                    
250	matches := regex.FindStringSubmatch(logs)
                    
                
utils.go https://gitlab.com/Realtyka/platform | Go | 368 lines
                    
14	"net/url"
                    
15	"regexp"
                    
16	"strings"
                    
92	encoder := base32.NewEncoder(encoding, &b)
                    
93	encoder.Write(uuid.NewRandom())
                    
94	encoder.Close()
                    
215
                    
216var wwwStart = regexp.MustCompile(`^www`)
                    
217var betaStart = regexp.MustCompile(`^beta`)
                    
217var betaStart = regexp.MustCompile(`^beta`)
                    
218var ciStart = regexp.MustCompile(`^ci`)
                    
219
                    
352
                    
353var UrlRegex = regexp.MustCompile(`^((?:[a-z]+:\/\/)?(?:(?:[a-z0-9\-]+\.)+(?:[a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel|local|internal))(:[0-9]{1,5})?(?:\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(?:\?[a-z0-9+_~\-\.%=&amp;]*)?)?(?:#[a-zA-Z0-9!$&'()*+.=-_~:@/?]*)?)(?:\s+|$)$`)
                    
354var PartialUrlRegex = regexp.MustCompile(`/([A-Za-z0-9]{26})/([A-Za-z0-9]{26})/((?:[A-Za-z0-9]{26})?.+(?:\.[A-Za-z0-9]{3,})?)`)
                    
                
user_event.go https://github.com/backstage/backstage.git | Go | 265 lines
                    
4	"fmt"
                    
5	"regexp"
                    
6
                    
7	"github.com/hashicorp/consul/consul/structs"
                    
8	"github.com/hashicorp/go-uuid"
                    
9)
                    
56	if params.NodeFilter != "" {
                    
57		if _, err := regexp.Compile(params.NodeFilter); err != nil {
                    
58			return fmt.Errorf("Invalid node filter: %v", err)
                    
82	var err error
                    
83	if params.ID, err = uuid.GenerateUUID(); err != nil {
                    
84		return fmt.Errorf("UUID generation failed: %v", err)
                    
163
                    
164		var tagRe *regexp.Regexp
                    
165		if msg.TagFilter != "" {
                    
                
format_checkers.go https://gitlab.com/CORP-RESELLER/amazon-ecs-cli | Go | 194 lines
                    
60
                    
61	// UUIDFormatChecker validates a UUID is in the correct format
                    
62	UUIDFormatChecker struct{}
                    
63
                    
64	// RegexFormatChecker validates a regex is in the correct format
                    
65	RegexFormatChecker struct{}
                    
78			"uri":       URIFormatChecker{},
                    
79			"uuid":      UUIDFormatChecker{},
                    
80			"regex":     UUIDFormatChecker{},
                    
84	// Regex credit: https://github.com/asaskevich/govalidator
                    
85	rxEmail = regexp.MustCompile("^(((([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+(\\.([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|\\.|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.)+(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|\\.|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.?$")
                    
86
                    
89
                    
90	rxUUID = regexp.MustCompile("^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$")
                    
91)
                    
                
downward_api.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 382 lines
                    
45	framework.ConformanceIt("should provide pod name, namespace and IP address as env vars ", func() {
                    
46		podName := "downward-api-" + string(uuid.NewUUID())
                    
47		env := []v1.EnvVar{
                    
92		framework.SkipUnlessServerVersionGTE(hostIPVersion, f.ClientSet.Discovery())
                    
93		podName := "downward-api-" + string(uuid.NewUUID())
                    
94		env := []v1.EnvVar{
                    
118	framework.ConformanceIt("should provide container's limits.cpu/memory and requests.cpu/memory as env vars ", func() {
                    
119		podName := "downward-api-" + string(uuid.NewUUID())
                    
120		env := []v1.EnvVar{
                    
170	framework.ConformanceIt("should provide default limits.cpu/memory from node allocatable ", func() {
                    
171		podName := "downward-api-" + string(uuid.NewUUID())
                    
172		env := []v1.EnvVar{
                    
221		framework.SkipUnlessServerVersionGTE(podUIDVersion, f.ClientSet.Discovery())
                    
222		podName := "downward-api-" + string(uuid.NewUUID())
                    
223		env := []v1.EnvVar{
                    
                
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
                    
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>
                    
6package uuid
                    
7
                    
9	"fmt"
                    
10	"regexp"
                    
11	"testing"
                    
18	if err == nil {
                    
19		t.Errorf("Expected error due to invalid UUID sequence")
                    
20	}
                    
23	if err != nil {
                    
24		t.Errorf("Expected to parse UUID sequence without problems")
                    
25		return
                    
                
dockershim_checkpoint_test.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 229 lines
                    
24	"path"
                    
25	"regexp"
                    
26	"strings"
                    
32	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
                    
33	"k8s.io/apimachinery/pkg/util/uuid"
                    
34	"k8s.io/apimachinery/pkg/util/wait"
                    
151func runPodCheckpointTest(f *framework.Framework, podName string, twist func()) {
                    
152	podName = podName + string(uuid.NewUUID())
                    
153	By(fmt.Sprintf("Creating test pod: %s", podName))
                    
187	processed := strings.TrimSpace(string(output))
                    
188	regex := regexp.MustCompile(`\r?\n`)
                    
189	processed = regex.ReplaceAllString(processed, "")
                    
                
gatt_tool.go https://gitlab.com/brucealdridge/driver-go-blecombined | Go | 162 lines
                    
11	"os/exec"
                    
12	"regexp"
                    
13	"strings"
                    
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 ]+)`)
                    
40type Characteristic struct {
                    
41	UUID            string
                    
42	Handle          string // use this to READ
                    
62		c := &Characteristic{
                    
63			UUID:            params["uuid"],
                    
64			Handle:          params["handle"],
                    
135
                    
136	matches := charRegex.FindAllStringSubmatch(line, -1)
                    
137
                    
                
descriptors.go https://gitlab.com/liwh/docker | Go | 1505 lines
                    
29	uuidParameterDescriptor = ParameterDescriptor{
                    
30		Name:        "uuid",
                    
31		Type:        "opaque",
                    
32		Required:    true,
                    
33		Description: "A uuid identifying the upload. This field can accept characters that match `[a-zA-Z0-9-_.=]+`.",
                    
34	}
                    
77	dockerUploadUUIDHeader = ParameterDescriptor{
                    
78		Name:        "Docker-Upload-UUID",
                    
79		Description: "Identifies the docker upload uuid for the current request.",
                    
358	// the contents of the parameter.
                    
359	Regexp *regexp.Regexp
                    
360
                    
491		Name:        RouteNameManifest,
                    
492		Path:        "/v2/{name:" + reference.NameRegexp.String() + "}/manifests/{reference:" + reference.TagRegexp.String() + "|" + digest.DigestRegexp.String() + "}",
                    
493		Entity:      "Manifest",
                    
                
cloudstack.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 936 lines
                    
30	"net/url"
                    
31	"regexp"
                    
32	"sort"
                    
39
                    
40var idRegex = regexp.MustCompile(`^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|-1)$`)
                    
41
                    
41
                    
42// IsID return true if the passed ID is either a UUID or a UnlimitedResourceID
                    
43func IsID(id string) bool {
                    
43func IsID(id string) bool {
                    
44	return idRegex.MatchString(id)
                    
45}
                    
                
virtual_device_list.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 935 lines
                    
23	"reflect"
                    
24	"regexp"
                    
25	"sort"
                    
134			b := backing.(*types.VirtualEthernetCardDistributedVirtualPortBackingInfo)
                    
135			return a.Port.SwitchUuid == b.Port.SwitchUuid &&
                    
136				a.Port.PortgroupKey == b.Port.PortgroupKey
                    
                
fs.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 766 lines
                    
87	dmsetup devicemapper.DmsetupClient
                    
88	// fsUUIDToDeviceName is a map from the filesystem UUID to its device name.
                    
89	fsUUIDToDeviceName map[string]string
                    
114
                    
115	fsUUIDToDeviceName, err := getFsUUIDToDeviceNameMap()
                    
116	if err != nil {
                    
118		// Do not fail if there is an error.
                    
119		glog.Warningf("Failed to get disk UUID mapping, getting disk info by uuid will not work: %v", err)
                    
120	}
                    
440
                    
441var partitionRegex = regexp.MustCompile(`^(?:(?:s|v|xv)d[a-z]+\d*|dm-\d+)$`)
                    
442
                    
508func (self *RealFsInfo) GetDeviceInfoByFsUUID(uuid string) (*DeviceInfo, error) {
                    
509	deviceName, found := self.fsUUIDToDeviceName[uuid]
                    
510	if !found {
                    
                
default.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 1359 lines
                    
50	HostnamePattern = `^[a-zA-Z](([-0-9a-zA-Z]+)?[0-9a-zA-Z])?(\.[a-zA-Z](([-0-9a-zA-Z]+)?[0-9a-zA-Z])?)*$`
                    
51	// UUIDPattern Regex for UUID that allows uppercase
                    
52	UUIDPattern = `(?i)^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$`
                    
52	UUIDPattern = `(?i)^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$`
                    
53	// UUID3Pattern Regex for UUID3 that allows uppercase
                    
54	UUID3Pattern = `(?i)^[0-9a-f]{8}-[0-9a-f]{4}-3[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$`
                    
54	UUID3Pattern = `(?i)^[0-9a-f]{8}-[0-9a-f]{4}-3[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$`
                    
55	// UUID4Pattern Regex for UUID4 that allows uppercase
                    
56	UUID4Pattern = `(?i)^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$`
                    
62	rxHostname = regexp.MustCompile(HostnamePattern)
                    
63	rxUUID     = regexp.MustCompile(UUIDPattern)
                    
64	rxUUID3    = regexp.MustCompile(UUID3Pattern)
                    
65	rxUUID4    = regexp.MustCompile(UUID4Pattern)
                    
66	rxUUID5    = regexp.MustCompile(UUID5Pattern)
                    
67)
                    
                
validator.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 924 lines
                    
249
                    
250// IsUUIDv3 check if the string is a UUID version 3.
                    
251func IsUUIDv3(str string) bool {
                    
254
                    
255// IsUUIDv4 check if the string is a UUID version 4.
                    
256func IsUUIDv4(str string) bool {
                    
256func IsUUIDv4(str string) bool {
                    
257	return rxUUID4.MatchString(str)
                    
258}
                    
259
                    
260// IsUUIDv5 check if the string is a UUID version 5.
                    
261func IsUUIDv5(str string) bool {
                    
264
                    
265// IsUUID check if the string is a UUID (version 3, 4 or 5).
                    
266func IsUUID(str string) bool {
                    
                
types.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 378 lines
                    
4	"reflect"
                    
5	"regexp"
                    
6	"sync"
                    
36// ParamTagRegexMap maps param tags to their respective regexes.
                    
37var ParamTagRegexMap = map[string]*regexp.Regexp{
                    
38	"length":       regexp.MustCompile("^length\\((\\d+)\\|(\\d+)\\)$"),
                    
38	"length":       regexp.MustCompile("^length\\((\\d+)\\|(\\d+)\\)$"),
                    
39	"stringlength": regexp.MustCompile("^stringlength\\((\\d+)\\|(\\d+)\\)$"),
                    
40	"matches":      regexp.MustCompile(`matches\(([^)]+)\)`),
                    
88	"null":           IsNull,
                    
89	"uuid":           IsUUID,
                    
90	"uuidv3":         IsUUIDv3,
                    
90	"uuidv3":         IsUUIDv3,
                    
91	"uuidv4":         IsUUIDv4,
                    
92	"uuidv5":         IsUUIDv5,
                    
                
run_remote.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 784 lines
                    
31	"path/filepath"
                    
32	"regexp"
                    
33	"sort"
                    
41	"github.com/golang/glog"
                    
42	"github.com/pborman/uuid"
                    
43	"golang.org/x/oauth2"
                    
148	Metadata   string `json:"metadata"`
                    
149	ImageRegex string `json:"image_regex,omitempty"`
                    
150	// Defaults to using only the latest image. Acceptable values are [0, # of images that match the regex).
                    
155	Resources Resources `json:"resources,omitempty"`
                    
156	// This test is for benchmark (no limit verification, more result log, node name has format 'machine-image-uuid') if 'Tests' is non-empty.
                    
157	Tests []string `json:"tests,omitempty"`
                    
294	if *instanceNamePrefix == "" {
                    
295		*instanceNamePrefix = "tmp-node-e2e-" + uuid.NewUUID().String()[:8]
                    
296	}
                    
                
vsphere_utils.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 822 lines
                    
23	"path/filepath"
                    
24	"regexp"
                    
25	"strings"
                    
40	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
                    
41	"k8s.io/apimachinery/pkg/util/uuid"
                    
42	"k8s.io/apimachinery/pkg/util/wait"
                    
354				{
                    
355					Name:         "vsphere-e2e-container-" + string(uuid.NewUUID()),
                    
356					Image:        "busybox",
                    
427	// Get the datastore folder ID if datastore or folder doesn't exist in datastoreFolderIDMap
                    
428	if !isValidUUID(dsFolder) {
                    
429		dummyDiskVolPath := "[" + datastore + "] " + dsFolder + "/" + DummyDiskName
                    
433		if err != nil {
                    
434			re := regexp.MustCompile("File (.*?) was not found")
                    
435			match := re.FindStringSubmatch(err.Error())
                    
                
kubectl.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 1135 lines
                    
36	"path/filepath"
                    
37	"regexp"
                    
38	"sort"
                    
54	utilnet "k8s.io/apimachinery/pkg/util/net"
                    
55	"k8s.io/apimachinery/pkg/util/uuid"
                    
56	"k8s.io/apimachinery/pkg/util/wait"
                    
119var (
                    
120	proxyRegexp = regexp.MustCompile("Starting to serve on 127.0.0.1:([0-9]+)")
                    
121
                    
                
util.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 1381 lines
                    
34	"path/filepath"
                    
35	"regexp"
                    
36	"sort"
                    
64	"k8s.io/apimachinery/pkg/util/sets"
                    
65	"k8s.io/apimachinery/pkg/util/uuid"
                    
66	"k8s.io/apimachinery/pkg/util/wait"
                    
218	// For parsing Kubectl version for version-skewed testing.
                    
219	gitVersionRegexp = regexp.MustCompile("GitVersion:\"(v.+?)\"")
                    
220
                    
221	// Slice of regexps for names of pods that have to be running to consider a Node "healthy"
                    
222	requiredPerNodePods = []*regexp.Regexp{
                    
223		regexp.MustCompile(".*kube-proxy.*"),
                    
263// unique identifier of the e2e run
                    
264var RunId = uuid.NewUUID()
                    
265
                    
                
cluster_size_autoscaling.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 1190 lines
                    
25	"os/exec"
                    
26	"regexp"
                    
27	"strconv"
                    
40	"k8s.io/apimachinery/pkg/util/sets"
                    
41	"k8s.io/apimachinery/pkg/util/uuid"
                    
42	"k8s.io/apimachinery/pkg/util/wait"
                    
                
rbd.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 1127 lines
                    
22	"path/filepath"
                    
23	"regexp"
                    
24	dstrings "strings"
                    
31	"k8s.io/apimachinery/pkg/util/sets"
                    
32	"k8s.io/apimachinery/pkg/util/uuid"
                    
33	clientset "k8s.io/client-go/kubernetes"
                    
403
                    
404	globalMapPathUUID, err := blkutil.FindGlobalMapPathUUIDFromPod(pluginDir, mapPath, podUID)
                    
405	if err != nil {
                    
407	}
                    
408	glog.V(5).Infof("globalMapPathUUID: %v, err: %v", globalMapPathUUID, err)
                    
409	globalMapPath := filepath.Dir(globalMapPathUUID)
                    
410	if len(globalMapPath) == 1 {
                    
411		return nil, fmt.Errorf("failed to retrieve volume plugin information from globalMapPathUUID: %v", globalMapPathUUID)
                    
412	}
                    
                
host_path_test.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 687 lines
                    
28	"k8s.io/apimachinery/pkg/types"
                    
29	"k8s.io/apimachinery/pkg/util/uuid"
                    
30	"k8s.io/client-go/kubernetes/fake"
                    
100	// Deleter has a hard-coded regex for "/tmp".
                    
101	tempPath := fmt.Sprintf("/tmp/hostpath/%s", uuid.NewUUID())
                    
102	defer os.RemoveAll(tempPath)
                    
157func TestProvisioner(t *testing.T) {
                    
158	tempPath := fmt.Sprintf("/tmp/hostpath/%s", uuid.NewUUID())
                    
159	defer os.RemoveAll(tempPath)
                    
                
vsphere_util.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 579 lines
                    
22	"os"
                    
23	"regexp"
                    
24	"strings"
                    
47	DummyDiskName         = "kube-dummyDisk.vmdk"
                    
48	UUIDPath              = "/sys/class/dmi/id/product_serial"
                    
49	UUIDPrefix            = "VMware-"
                    
331	if !datastoreExists || !folderExists {
                    
332		if !vclib.IsValidUUID(dsFolder) {
                    
333			dummyDiskVolPath := "[" + datastore + "] " + dsFolder + "/" + DummyDiskName
                    
337			if err != nil {
                    
338				re := regexp.MustCompile("File (.*?) was not found")
                    
339				match := re.FindStringSubmatch(err.Error())
                    
                
azure_standard.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 729 lines
                    
22	"hash/crc32"
                    
23	"regexp"
                    
24	"sort"
                    
37	"k8s.io/apimachinery/pkg/util/sets"
                    
38	"k8s.io/apimachinery/pkg/util/uuid"
                    
39)
                    
60var errNotInVMSet = errors.New("vm is not in the vmset")
                    
61var providerIDRE = regexp.MustCompile(`^` + CloudProviderName + `://(?:.*)/Microsoft.Compute/virtualMachines/(.+)$`)
                    
62var backendPoolIDRE = regexp.MustCompile(`^/subscriptions/(?:.*)/resourceGroups/(?:.*)/providers/Microsoft.Network/loadBalancers/(.+)/backendAddressPools/(?:.*)`)
                    
                
util.go https://gitlab.com/CORP-RESELLER/kubernetes | Go | 1369 lines
                    
32	"path/filepath"
                    
33	"regexp"
                    
34	goRuntime "runtime"
                    
69	"k8s.io/kubernetes/pkg/util/system"
                    
70	"k8s.io/kubernetes/pkg/util/uuid"
                    
71	"k8s.io/kubernetes/pkg/util/wait"
                    
168	// For parsing Kubectl version for version-skewed testing.
                    
169	gitVersionRegexp = regexp.MustCompile("GitVersion:\"(v.+?)\"")
                    
170)
                    
218// unique identifier of the e2e run
                    
219var RunId = uuid.NewUUID()
                    
220
                    
                
kubectl.go https://gitlab.com/CORP-RESELLER/kubernetes | Go | 1275 lines
                    
34	"path/filepath"
                    
35	"regexp"
                    
36	"sort"
                    
54	utilnet "k8s.io/kubernetes/pkg/util/net"
                    
55	"k8s.io/kubernetes/pkg/util/uuid"
                    
56	"k8s.io/kubernetes/pkg/util/wait"
                    
93var (
                    
94	proxyRegexp = regexp.MustCompile("Starting to serve on 127.0.0.1:([0-9]+)")
                    
95
                    
                
rackspace.go https://gitlab.com/CORP-RESELLER/kubernetes | Go | 647 lines
                    
26	"os"
                    
27	"regexp"
                    
28	"strings"
                    
69type MetaData struct {
                    
70	UUID string `json:"uuid"`
                    
71	Name string `json:"name"`
                    
150
                    
151	return metaData.UUID, nil
                    
152}
                    
316	opts := osservers.ListOpts{
                    
317		Name:   fmt.Sprintf("^%s$", regexp.QuoteMeta(name)),
                    
318		Status: "ACTIVE",
                    
                
descriptors.go https://gitlab.com/CORP-RESELLER/cf-distribution | Go | 1523 lines
                    
22		Type:        "string",
                    
23		Format:      TagNameRegexp.String(),
                    
24		Required:    true,
                    
27
                    
28	uuidParameterDescriptor = ParameterDescriptor{
                    
29		Name:        "uuid",
                    
38		Required:    true,
                    
39		Format:      digest.DigestRegexp.String(),
                    
40		Description: `Digest of desired blob.`,
                    
76	dockerUploadUUIDHeader = ParameterDescriptor{
                    
77		Name:        "Docker-Upload-UUID",
                    
78		Description: "Identifies the docker upload uuid for the current request.",
                    
335	// the contents of the parameter.
                    
336	Regexp *regexp.Regexp
                    
337
                    
                
functionaltests_test.go https://gitlab.com/CORP-RESELLER/amazon-ecs-agent | Go | 721 lines
                    
23	"reflect"
                    
24	"regexp"
                    
25	"strings"
                    
35	docker "github.com/fsouza/go-dockerclient"
                    
36	"github.com/pborman/uuid"
                    
37)
                    
488	//    1445018173.731   3086 10.0.0.1 TCP_MISS/200 3411 CONNECT ecs-t-1.us-west-2.amazonaws.com:443 - HIER_DIRECT/54.240.254.59
                    
489	allAddressesRegex := regexp.MustCompile("CONNECT [^ ]+ ")
                    
490	// Match just the host+port it's proxying to
                    
490	// Match just the host+port it's proxying to
                    
491	matches := allAddressesRegex.FindAllStringSubmat
                    
                
types.go https://gitlab.com/github-cloud-corporation/prometheus | Go | 356 lines
                    
4	"reflect"
                    
5	"regexp"
                    
6)
                    
33
                    
34var ParamTagRegexMap = map[string]*regexp.Regexp{
                    
35	"length":       regexp.MustCompile("^length\\((\\d+)\\|(\\d+)\\)$"),
                    
35	"length":       regexp.MustCompile("^length\\((\\d+)\\|(\\d+)\\)$"),
                    
36	"stringlength": regexp.MustCompile("^stringlength\\((\\d+)\\|(\\d+)\\)$"),
                    
37	"matches":      regexp.MustCompile(`matches\(([^)]+)\)`),
                    
66	"null":           IsNull,
                    
67	"uuid":           IsUUID,
                    
68	"uuidv3":         IsUUIDv3,
                    
68	"uuidv3":         IsUUIDv3,
                    
69	"uuidv4":         IsUUIDv4,
                    
70	"uuidv5":         IsUUIDv5,
                    
                
run_e2e.go https://gitlab.com/github-cloud-corporation/kubernetes | Go | 566 lines
                    
30	"os/exec"
                    
31	"regexp"
                    
32	"sort"
                    
95	Metadata   string `json:"metadata"`
                    
96	ImageRegex string `json:"image_regex, omitempty"`
                    
97	// Defaults to using only the latest image. Acceptible values are [0, # of images that match the regex).
                    
195	if *instanceNamePrefix == "" {
                    
196		*instanceNamePrefix = "tmp-node-e2e-" + uuid.NewUUID().String()[:8]
                    
197	}
                    
366	imageObjs := []imageObj{}
                    
367	imageRe := regexp.MustCompile(imageRegex)
                    
368	for _, instance := range ilc.Items {
                    
377			}
                    
378			glog.V(4).Infof("Found image %q based on regex %q in project %q", io.string(), imageRegex, project)
                    
379			imageObjs = append(imageObjs, io)
                    
                
nspawn.go https://gitlab.com/github-cloud-corporation/fleet | Go | 785 lines
                    
26	"path"
                    
27	"regexp"
                    
28	"runtime"
                    
73type nspawnMember struct {
                    
74	uuid string
                    
75	id   string
                    
80func (m *nspawnMember) ID() string {
                    
81	return m.uuid
                    
82}
                    
400	nm := nspawnMember{
                    
401		uuid: util.NewMachineID(),
                    
402		id:   id,
                    
521		"-b",
                    
522		"--uuid=" + nm.uuid,
                    
523		fmt.Sprintf("-M %s%s", nc.name, nm.ID()),
                    
                
model.go https://bitbucket.org/matchmove/go-cqlorm.git | Go | 360 lines
                    
62
                    
63	// EmptyUUID ...
                    
64	EmptyUUID = "00000000-0000-0000-0000-000000000000"
                    
282		if OperatorLike == cond.Operator {
                    
283			if v, err = param.ParseFilter(v, param.FilterRegexMatchAll); nil != err {
                    
284				return
                    
                
utils.go https://gitlab.com/unofficial-mirrors/mattermost-platform | Go | 538 lines
                    
18	"reflect"
                    
19	"regexp"
                    
20	"strconv"
                    
26	goi18n "github.com/nicksnyder/go-i18n/i18n"
                    
27	"github.com/pborman/uuid"
                    
28)
                    
123// NewId is a globally unique identifier.  It is a [A-Z0-9] string 26
                    
124// characters long.  It is a UUID version 4 Guid that is zbased32 encoded
                    
125// with the padding stripped off.
                    
128	encoder := base32.NewEncoder(encoding, &b)
                    
129	encoder.Write(uuid.NewRandom())
                    
130	encoder.Close()
                    
317func IsValidAlphaNum(s string) bool {
                    
318	validAlphaNum := regexp.MustCompile(`^[a-z0-9]+([a-z\-0-9]+|(__)?)[a-z0-9]+$`)
                    
319
                    
                
baked_in.go https://gitlab.com/rpi-romlinch/drone | Go | 1001 lines
                    
106
                    
107	return matchesRegex(multibyteRegex, field)
                    
108}
                    
118func isUUID5(top interface{}, current interface{}, field interface{}, param string) bool {
                    
119	return matchesRegex(uUID5Regex, field)
                    
120}
                    
122func isUUID4(top interface{}, current interface{}, field interface{}, param string) bool {
                    
123	return matchesRegex(uUID4Regex, field)
                    
124}
                    
126func isUUID3(top interface{}, current interface{}, field interface{}, param string) bool {
                    
127	return matchesRegex(uUID3Regex, field)
                    
128}
                    
130func isUUID(top interface{}, current interface{}, field interface{}, param string) bool {
                    
131	return matchesRegex(uUIDRegex, field)
                    
132}
                    
                
config.go https://gitlab.com/karouf/heka | Go | 846 lines
                    
28	"reflect"
                    
29	"regexp"
                    
30	"sync"
                    
33	"github.com/bbangert/toml"
                    
34	"github.com/pborman/uuid"
                    
35)
                    
240	pack.Message.SetTimestamp(time.Now().UnixNano())
                    
241	pack.Message.SetUuid(uuid.NewRandom())
                    
242	pack.Message.SetHostname(self.hostname)
                    
                
control.go https://gitlab.com/tnir/gitlab-runner | Go | 282 lines
                    
9	"os/exec"
                    
10	"regexp"
                    
11	"strings"
                    
108	}
                    
109	portRe := regexp.MustCompile(`guestssh.*host port = (\d+)`)
                    
110	sshPort := portRe.FindStringSubmatch(info)
                    
149	}
                    
150	allPortsRe := regexp.MustCompile(`host port = (\d+)`)
                    
151	usedPorts = allPortsRe.FindAllStringSubmatch(output, -1)
                    
206	snapshotRe := regexp.MustCompile(
                    
207		fmt.Sprintf(`(?m)^Snapshot(Name|UUID)[^=]*="(%s)"\r?$`, regexp.QuoteMeta(snapshotName)),
                    
208	)
                    
221func matchCurrentSnapshotName(snapshotList string) []string {
                    
222	snapshotRe := regexp.MustCompile(`(?m)^CurrentSnapshotName="([^"]*)"\r?$`)
                    
223	return snapshotRe.FindStringSubmatch(snapshotList)
                    
                
rkt_export_test.go https://gitlab.com/unofficial-mirrors/openshift-origin | Go | 169 lines
                    
137	t.Logf("Preparing 'inspect --write-file'")
                    
138	uuid := runRktAndGetUUID(t, prepareCmd)
                    
139
                    
139
                    
140	runCmd := fmt.Sprintf("%s run-prepared %s", ctx.Cmd(), uuid)
                    
141	t.Logf("Running 'inspect --write-file'")
                    
145	if ct.unmountOverlay {
                    
146		unmountPod(t, ctx, uuid, true)
                    
147	}
                    
149	// Export the image
                    
150	exportCmd := fmt.Sprintf("%s export %s %s %s", ctx.Cmd(), ct.exportArgs, uuid, tmpTestAci)
                    
151	t.Logf("Running 'export'")
                    
159	if ct.expectedResult != "" {
                    
160		if _, out, err := expectRegexWithOutput(child, ct.expectedResult); err != nil {
                    
161			t.Fatalf("expected %q but not found: %v\n%s", ct.expectedResult, err, out)
                    
                
rkt_list_test.go https://gitlab.com/unofficial-mirrors/openshift-origin | Go | 182 lines
                    
54	cmd := fmt.Sprintf("%s --insecure-options=image prepare %s", ctx.Cmd(), imgID.path)
                    
55	podUuid := runRktAndGetUUID(t, cmd)
                    
56
                    
65	}{
                    
66		// Test that pod UUID is in output
                    
67		{
                    
69			true,
                    
70			podUuid,
                    
71		},
                    
119	match := fmt.Sprintf(".*%s\t.*\t(.*)\t(.*)\t", imageID)
                    
120	result, out, err := expectRegexWithOutput(child, match)
                    
121	if err != nil {
                    
152	cmd := fmt.Sprintf("%s --insecure-options=image prepare %s", ctx.Cmd(), imgID.path)
                    
153	podUuid := runRktAndGetUUID(t, cmd)
                    
154
                    
                
init.go https://gitlab.com/Lin0x/oz | Go | 823 lines
                    
15	"path/filepath"
                    
16	"regexp"
                    
17	"strconv"
                    
76
                    
77var dbusValidVar = regexp.MustCompile(DBUS_VAR_REGEXP)
                    
78
                    
263	exec.Command("/usr/bin/dbus-uuidgen", "--ensure").Run()
                    
264	buuid, err := exec.Command("/usr/bin/dbus-uuidgen", "--get").CombinedOutput()
                    
265	if err != nil || string(buuid) == "" {
                    
265	if err != nil || string(buuid) == "" {
                    
266		return fmt.Errorf("dbus-uuidgen failed: %v %v", err, string(buuid))
                    
267	}
                    
267	}
                    
268	st.dbusUuid = strings.TrimSpace(string(bytes.Trim(buuid, "\x00")))
                    
269	st.log.Debug("dbus-uuid: %s", st.dbusUuid)
                    
                
baked_in.go https://gitlab.com/kingwill101/palaceapi | Go | 1274 lines
                    
69	"isbn13":       IsISBN13,
                    
70	"uuid":         IsUUID,
                    
71	"uuid3":        IsUUID3,
                    
71	"uuid3":        IsUUID3,
                    
72	"uuid4":        IsUUID4,
                    
73	"uuid5":        IsUUID5,
                    
239func IsUUID3(v *Validate, topStruct reflect.Value, currentStructOrField reflect.Value, field reflect.Value, fieldType reflect.Type, fieldKind reflect.Kind, param string) bool {
                    
240	return uUID3Regex.MatchString(field.String())
                    
241}
                    
242
                    
243// IsUUID is the validation function for validating if the field's value is a valid UUID of any version.
                    
244// NOTE: This is exposed for use within your own custom functions and not intended to be called directly.
                    
245func IsUUID(v *Validate, topStruct reflect.Value, currentStructOrField reflect.Value, field reflect.Value, fieldType reflect.Type, fieldKind reflect.Kind, param string) bool {
                    
246	return uUIDRegex.MatchString(field.String())
                    
247}
                    
                
docker.go https://gitlab.com/oytunistrator/dockertest | Go | 507 lines
                    
31	"math/rand"
                    
32	"regexp"
                    
33
                    
35	"github.com/mediocregopher/radix.v2/redis"
                    
36	"github.com/pborman/uuid"
                    
37	"gopkg.in/mgo.v2"
                    
106	var stdout, stderr bytes.Buffer
                    
107	validID := regexp.MustCompile(`^([a-zA-Z0-9]+)$`)
                    
108	cmd := runDockerCommand("docker", append([]string{"run"}, args...)...)
                    
229	c, ip, err = setupContainer(mongoImage, port, 10*time.Second, func() (string, error) {
                    
230		res, err := run("--name", uuid.New(), "-d", "-P", "-p", forward, mongoImage)
                    
231		return res, err
                    
275	c, ip, err = setupContainer(elasticsearchImage, port, 15*time.Second, func() (string, error) {
                    
276		return run("--name", uuid.New(), "-d", "-P", "-p", forward, elasticsearchImage)
                    
277	})
                    
                
uuid.go https://gitlab.com/aviz/go-uuid | Go | 185 lines
                    
44// RFC 4122 document.
                    
45type UUID [16]byte
                    
46
                    
52//     uuid.ParseHex("{6ba7b814-9dad-11d1-80b4-00c04fd430c8}")
                    
53//     uuid.ParseHex("urn:uuid:6ba7b814-9dad-11d1-80b4-00c04fd430c8")
                    
54//
                    
76	}
                    
77	u = new(UUID)
                    
78	copy(u[:], b)
                    
83// and a name.
                    
84func NewV3(ns *UUID, name []byte) (u *UUID, err error) {
                    
85	if ns == nil {
                    
111// and a name.
                    
112func NewV5(ns *UUID, name []byte) (u *UUID, err error) {
                    
113	u = new(UUID)
                    
                
message_template.go https://gitlab.com/karouf/heka | Go | 116 lines
                    
27
                    
28// Populated by the init function, this regex matches the MessageFields values
                    
29// to interpolate variables from capture groups or other parts of the existing
                    
30// message.
                    
31var varMatcher *regexp.Regexp
                    
32
                    
69			msg.SetSeverity(int32(severity))
                    
70		case "Uuid":
                    
71			if len(val) == message.UUID_SIZE {
                    
73			} else {
                    
74				if uuidBytes := uuid.Parse(val); uuidBytes == nil {
                    
75					return errors.New("Invalid UUID string.")
                    
76				} else {
                    
77					msg.SetUuid(uuidBytes)
                    
78				}
                    
                
encode.go https://gitlab.com/nidhomriza/handbook-tes | Go | 628 lines
                    
10	"math"
                    
11	"regexp"
                    
12	"strconv"
                    
19
                    
20var time2400Regex = regexp.MustCompile(`^(24:00(?::00(?:\.0+)?)?)(?:[Z+-].*)?$`)
                    
21
                    
81		return int64(int16(binary.BigEndian.Uint16(s)))
                    
82	case oid.T_uuid:
                    
83		b, err := decodeUUIDBinary(s)
                    
221	case oid.T_timetz, oid.T_time:
                    
222		if matches := time2400Regex.FindStringSubmatch(str); matches != nil {
                    
223			// Concatenate timezone information at the back.
                    
                
rkt_tests.go https://gitlab.com/unofficial-mirrors/openshift-origin | Go | 1039 lines
                    
79func expectRegexTimeoutWithOutput(p *gexpect.ExpectSubprocess, searchPattern string, timeout time.Duration) ([]string, string, error) {
                    
80	return p.ExpectTimeoutRegexFindWithOutput(searchPattern, timeout)
                    
81}
                    
143// waitPodReady waits for the pod supervisor to get ready, busy-looping until `timeout`
                    
144// while waiting for it. It returns the pod UUID or an error on failure.
                    
145func waitPodReady(ctx *testutils.RktRunCtx, t *testing.T, uuidFile string, timeout time.Duration) (string, error) {
                    
153		elapsed += interval
                    
154		podUUID, err = ioutil.ReadFile(uuidFile)
                    
155		if err == nil {
                    
176// while waiting for it. It returns an error on failure.
                    
177func waitAppAttachable(ctx *testutils.RktRunCtx, t *testing.T, podUUID, appName string, timeout time.Duration) error {
                    
178	var (
                    
186	}
                    
187	cmd := strings.Fields(fmt.Sprintf("%s attach --mode=list %s %s", ctx.Cmd(), appNameFlag, podUUID))
                    
188
                    
                
framework.go https://gitlab.com/unofficial-mirrors/openshift-origin | Go | 1389 lines
                    
10	"path/filepath"
                    
11	"regexp"
                    
12	"strings"
                    
26	"k8s.io/apimachinery/pkg/selection"
                    
27	"k8s.io/apimachinery/pkg/util/uuid"
                    
28	"k8s.io/apimachinery/pkg/util/wait"
                    
403
                    
404var buildPathPattern = regexp.MustCompile(`^build/([\w\-\._]+)$`)
                    
405
                    
                
host_path.go https://gitlab.com/unofficial-mirrors/kubernetes | Go | 456 lines
                    
21	"os"
                    
22	"regexp"
                    
23
                    
26	"k8s.io/apimachinery/pkg/types"
                    
27	"k8s.io/apimachinery/pkg/util/uuid"
                    
28	"k8s.io/kubernetes/pkg/util/mount"
                    
268func (r *hostPathProvisioner) Provision() (*v1.PersistentVolume, error) {
                    
269	fullpath := fmt.Sprintf("/tmp/hostpath_pv/%s", uuid.NewUUID())
                    
270
                    
315func (r *hostPathDeleter) Delete() error {
                    
316	regexp := regexp.MustCompile("/tmp/.+")
                    
317	if !regexp.MatchString(r.GetPath()) {
                    
                
legacy_deployment_state_migrator_test.go https://gitlab.com/JamesClonk/bosh-init | Go | 521 lines
                    
12	fakesys "github.com/cloudfoundry/bosh-init/internal/github.com/cloudfoundry/bosh-utils/system/fakes"
                    
13	fakeuuid "github.com/cloudfoundry/bosh-init/internal/github.com/cloudfoundry/bosh-utils/uuid/fakes"
                    
14)
                    
22		fakeFs                        *fakesys.FakeFileSystem
                    
23		fakeUUIDGenerator             *fakeuuid.FakeGenerator
                    
24	)
                    
27		fakeFs = fakesys.NewFakeFileSystem()
                    
28		fakeUUIDGenerator = fakeuuid.NewFakeGenerator()
                    
29		legacyDeploymentStateFilePath = "/path/to/legacy/bosh-deployment.yml"
                    
105
                    
106			It("uses the legacy UUID as the director_uuid in the new deployment manifest", func() {
                    
107				migrated, err := migrator.MigrateIfExists(legacyDeploymentStateFilePath)
                    
157
                    
158			It("generates a new UUID to use as the director_uuid in the new deployment manifest", func() {
                    
159				migrated, err := migrator.MigrateIfExists(legacyDeploymentStateFilePath)
                    
                
downward_api_test.go https://gitlab.com/github-cloud-corporation/bootkube | Go | 164 lines
                    
34	It("should provide pod name and namespace as env vars [Conformance]", func() {
                    
35		podName := "downward-api-" + string(util.NewUUID())
                    
36		env := []api.EnvVar{
                    
65	It("should provide pod IP as an env var", func() {
                    
66		podName := "downward-api-" + string(util.NewUUID())
                    
67		env := []api.EnvVar{
                    
86	It("should provide container's limits.cpu/memory and requests.cpu/memory as env vars", func() {
                    
87		podName := "downward-api-" + string(util.NewUUID())
                    
88		env := []api.EnvVar{
                    
162
                    
163	f.TestContainerOutputRegexp("downward api env vars", pod, 0, expectations)
                    
164}
                    
                
daisy.go https://gitlab.com/jramb/daisy | Go | 1524 lines
                    
60// ba7eaa41-9321-4895-a0e9-fb365612163e
                    
61var uuidRegexp = regexp.MustCompile(`^[[:xdigit:]]{8}-?[[:xdigit:]]{4}-?[[:xdigit:]]{4}-?[[:xdigit:]]{12}$`)
                    
62var sourcePathRegexp = regexp.MustCompile("^/source(?:/([^/]+)(?:/(.*))?)?")
                    
146
                    
147func uuidEnc(u uuid.UUID) string {
                    
148	if uuidStyle == "full" {
                    
153
                    
154func uuidDec(s string) (u uuid.UUID) {
                    
155	var err error
                    
336	return &JSONSource{
                    
337		SourceID:       uuidEnc(s.SourceID), // explicit uuid.String() conversion
                    
338		Binary:         s.Binary,
                    
555
                    
556func dbLinkSourceAccess(tx *bolt.Tx, s uuid.UUID, a uuid.UUID) error {
                    
557	b := tx.Bucket([]byte(bucketLinkSA))
                    
                
data.go https://bitbucket.org/nexneo/samay.git | Go | 254 lines
                    
6	"os"
                    
7	"regexp"
                    
8	"sort"
                    
172
                    
173	tagsFinder := regexp.MustCompile("\\B#(\\w\\w+)")
                    
174	for _, v := range tagsFinder.FindAllStringSubmatch(content, 20) {
                    
184	}
                    
185	id, _ := util.UUID()
                    
186	e.Id = proto.String(id)
                    
                
virtual_device_list.go https://gitlab.com/wilane/machine | Go | 754 lines
                    
23	"reflect"
                    
24	"regexp"
                    
25	"sort"
                    
128			b := backing.(*types.VirtualEthernetCardDistributedVirtualPortBackingInfo)
                    
129			return a.Port.SwitchUuid == b.Port.SwitchUuid
                    
130		case *types.VirtualDiskFlatVer2BackingInfo:
                    
                
uuids_test.go https://gitlab.com/CORP-RESELLER/amazon-ssm-agent | Go | 449 lines
                    
1package uuid
                    
2
                    
11	"fmt"
                    
12	"regexp"
                    
13	"strings"
                    
24var (
                    
25	uuid_goLang Name = "https://google.com/golang.org?q=golang"
                    
26	printer     bool = false
                    
37	}
                    
38	namespaceUuids = []UUID{
                    
39		NamespaceDNS, NamespaceURL, NamespaceOID, NamespaceX500,
                    
96	}
                    
97	if !parseUUIDRegex.MatchString(u.String()) {
                    
98		t.Errorf("Expected string representation to be valid, given: %s", u.String())
                    
241	}
                    
242	if !parseUUIDRegex.MatchString(u.String()) {
                    
243		t.Errorf("Expected string representation to be valid, given: %s", u.String())
                    
                
control.go https://gitlab.com/tnir/gitlab-runner | Go | 233 lines
                    
8	"os/exec"
                    
9	"regexp"
                    
10	"runtime"
                    
71
                    
72	versionRe := regexp.MustCompile(`prlctl version (\d+\.\d+.\d+)`)
                    
73	matches := versionRe.FindStringSubmatch(out)
                    
111			snapshot = strings.TrimSpace(snapshot)
                    
112			if len(snapshot) > 0 { // It uses UUID so it should be 38
                    
113				return snapshot, nil
                    
183	stdoutString := strings.TrimSpace(output)
                    
184	re := regexp.MustCompile("net0.* mac=([0-9A-F]{12}) card=.*")
                    
185	macMatch := re.FindAllStringSubmatch(stdoutString, 1)
                    
212
                    
213	re := regexp.MustCompile("(.*)=\"(.*),(.*)," + strings.ToLower(mac) + ",.*\"")
                    
214	mostRecentIP := ""
                    
                
uuids.go https://gitlab.com/CORP-RESELLER/amazon-ssm-agent | Go | 296 lines
                    
53var (
                    
54	parseUUIDRegex = regexp.MustCompile(hexPattern)
                    
55	format         string
                    
131func Parse(pUUID string) (UUID, error) {
                    
132	md := parseUUIDRegex.FindStringSubmatch(pUUID)
                    
133	if md == nil {
                    
232// Compares whether each UUID is the same
                    
233func Equal(p1 UUID, p2 UUID) bool {
                    
234	return 	bytes.Equal(p1.Bytes(), p2.Bytes())
                    
239// is overkill.
                    
240func Formatter(pUUID UUID, pFormat Format) string {
                    
241	form := string(pFormat)
                    
291// format a UUID into a human readable string
                    
292func formatter(pUUID UUID, pFormat string) string {
                    
293	b := pUUID.Bytes()
                    
                
vbm.go https://gitlab.com/JamesClonk/machine | Go | 90 lines
                    
9	"path/filepath"
                    
10	"regexp"
                    
11	"runtime"
                    
17var (
                    
18	reVMNameUUID      = regexp.MustCompile(`"(.+)" {([0-9a-f-]+)}`)
                    
19	reVMInfoLine      = regexp.MustCompile(`(?:"(.+)"|(.+))=(?:"(.*)"|(.*))`)
                    
19	reVMInfoLine      = regexp.MustCompile(`(?:"(.+)"|(.+))=(?:"(.*)"|(.*))`)
                    
20	reColonLine       = regexp.MustCompile(`(.+):\s+(.*)`)
                    
21	reMachineNotFound = regexp.MustCompile(`Could not find a registered machine named '(.+)'`)
                    
                
uuid_test.go https://gitlab.com/JamesClonk/bosh-init | Go | 135 lines
                    
1// This package provides immutable UUID structs and the functions
                    
2// NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4
                    
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>
                    
6package uuid
                    
7
                    
8import (
                    
9	"regexp"
                    
10	"testing"
                    
17	if err == nil {
                    
18		t.Errorf("Expected error due to invalid UUID sequence")
                    
19	}
                    
22	if err != nil {
                    
23		t.Errorf("Expected to parse UUID sequence without problems")
                    
24		return
                    
                
utils.go https://gitlab.com/auchalet/mattermost | Go | 422 lines
                    
242
                    
243var wwwStart = regexp.MustCompile(`^www`)
                    
244var betaStart = regexp.MustCompile(`^beta`)
                    
244var betaStart = regexp.MustCompile(`^beta`)
                    
245var ciStart = regexp.MustCompile(`^ci`)
                    
246
                    
288var validAlphaNumUnderscore = regexp.MustCompile(`^[a-z0-9]+([a-z\-\_0-9]+|(__)?)[a-z0-9]+$`)
                    
289var validAlphaNum = regexp.MustCompile(`^[a-z0-9]+([a-z\-0-9]+|(__)?)[a-z0-9]+$`)
                    
290
                    
316
                    
317var validHashtag = regexp.MustCompile(`^(#[A-Za-zäöüÄÖÜß]+[A-Za-z0-9äöüÄÖÜß_\-]*[A-Za-z0-9äöüÄÖÜß])$`)
                    
318var puncStart = regexp.MustCompile(`^[.,()&$!\?\[\]{}':;\\<>\-+=%^*|]+`)
                    
380
                    
381var UrlRegex = regexp.MustCompile(`^((?:[a-z]+:\/\/)?(?:(?:[a-z0-9\-]+\.)+(?:[a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel|local|internal))(:[0-9]{1,5})?(?:\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(?:\?[a-z0-9+_~\-\.%=&amp;]*)?)?(?:#[a-zA-Z0-9!$&'()*+.=-_~:@/?]*)?)(?:\s+|$)$`)
                    
382var PartialUrlRegex = regexp.MustCompile(`/([A-Za-z0-9]{26})/([A-Za-z0-9]{26})/((?:[A-Za-z0-9]{26})?.+(?:\.[A-Za-z0-9]{3,})?)`)
                    
                
go.go https://github.com/xo/xo.git | Go | 1961 lines
                    
14	"path/filepath"
                    
15	"regexp"
                    
16	"strconv"
                    
116			{
                    
117				ContextKey: UUIDKey,
                    
118				Type:       "string",
                    
118				Type:       "string",
                    
119				Desc:       "uuid type package",
                    
120				Default:    "github.com/google/uuid",
                    
                
results.go https://gitlab.com/unofficial-mirrors/openshift-origin | Go | 304 lines
                    
57	Name string `json:"name" required:"true"`
                    
58	// Specifies the request URL this rule should match for this origin to be used. Regex is supported.
                    
59	RequestURL string `json:"request_url" required:"true"`
                    
122	Name string `json:"name" required:"true"`
                    
123	// Specifies the request URL this rule should match for this TTL to be used. Regex is supported.
                    
124	RequestURL string `json:"request_url" required:"true"`
                    
201	// Specifies the service ID that represents distributed content. The value is
                    
202	// a UUID, such as 96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0, that is generated by the server.
                    
203	ID string `json:"id"`
                    
                
rkt_gc_test.go https://gitlab.com/admin-github-cloud/rkt | Go | 120 lines
                    
97		cmd := fmt.Sprintf("%s --insecure-options=image prepare %s", ctx.Cmd(), imagePath)
                    
98		uuid := runRktAndGetUUID(t, cmd)
                    
99
                    
99
                    
100		cmd = fmt.Sprintf("%s run-prepared %s", ctx.Cmd(), uuid)
                    
101		runRktAndCheckOutput(t, cmd, "", false)
                    
102
                    
103		unmountPod(t, ctx, uuid, rmNetns)
                    
104
                    
111		// check we don't get any output (an error) after "executing net-plugin..."
                    
112		runRktAndCheckRegexOutput(t, gcCmd, `executing net-plugin .*\n\z`)
                    
113
                    
                
workspacerouter.go https://gitlab.com/geropl/gitpod | Go | 196 lines
                    
45	return func(r *mux.Router, wsInfoProvider WorkspaceInfoProvider) (*mux.Router, *mux.Router, *mux.Router) {
                    
46		allClusterWsHostSuffixRegex := wsHostSuffixRegex
                    
47		if allClusterWsHostSuffixRegex == "" {
                    
77func matchWorkspaceHostHeader(wsHostSuffix string, headerProvider hostHeaderProvider, matchPort bool) mux.MatcherFunc {
                    
78	regexPrefix := workspaceIDRegex
                    
79	if matchPort {
                    
79	if matchPort {
                    
80		regexPrefix = workspacePortRegex + workspaceIDRegex
                    
81	}
                    
82
                    
83	r := regexp.MustCompile("^" + regexPrefix + wsHostSuffix)
                    
84	foreignContentHostR := regexp.MustCompile("^(.+)(?:foreign)" + wsHostSuffix)
                    
85	foreignContentHost2R := regexp.MustCompile("^((?:v--)?[0-9a-v]+)" + wsHostSuffix)
                    
86	foreignContentPathR := regexp.MustCompile("^/" + regexPrefix + "(/.*)")
                    
87	return func(req *http.Request, m *mux.RouteMatch) bool {
                    
                
requests.go https://gitlab.com/unofficial-mirrors/openshift-origin | Go | 164 lines
                    
4	"net"
                    
5	"regexp"
                    
6	"strings"
                    
48
                    
49	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}$")
                    
50
                    
51	if opts.Group != "" {
                    
52		if !uuidRegex.MatchString(opts.Group) {
                    
53			err := gophercloud.ErrInvalidInput{}
                    
63		for _, diffHost := range opts.DifferentHost {
                    
64			if !uuidRegex.MatchString(diffHost) {
                    
65				err := gophercloud.ErrInvalidInput{}
                    
76		for _, sameHost := range opts.SameHost {
                    
77			if !uuidRegex.MatchString(sameHost) {
                    
78				err := gophercloud.ErrInvalidInput{}
                    
                
driver_9.go https://gitlab.com/ozbillwang/packer | Go | 315 lines
                    
10	"path/filepath"
                    
11	"regexp"
                    
12	"strings"
                    
24
                    
25	err := d.Prlctl("register", srcPath, "--preserve-uuid")
                    
26	if err != nil {
                    
57func getVmId(path string) (string, error) {
                    
58	return getConfigValueFromXpath(path, "/ParallelsVirtualMachine/Identification/VmUuid")
                    
59}
                    
109
                    
110	deviceRe := regexp.MustCompile(`\s+(cdrom\d+)\s+`)
                    
111	matches := deviceRe.FindStringSubmatch(string(out))
                    
193
                    
194	versionRe := regexp.MustCompile(`prlctl version (\d+\.\d+.\d+)`)
                    
195	matches := versionRe.FindStringSubmatch(string(out))
                    
                
message_matcher_test.go https://gitlab.com/karouf/heka | Go | 305 lines
                    
32	msg := getTestMessage()
                    
33	uuidStr := msg.GetUuidString()
                    
34	data := []byte("data")
                    
70			"Fields[test][xxxx",                                           // unmatched bracket
                    
71			"Pid =~ /6/",                                                  // regex not allowed on numeric
                    
72			"Pid !~ /6/",                                                  // regex not allowed on numeric
                    
74			"Type == /test/",                                              // incorrect operator
                    
75			"Type =~ 'test'",                                              // string instead of regexp
                    
76			"Type =~ /\\ytest/",                                           // invalid escape character
                    
77			"Type != 'test\"",                                             // mis matched quote types
                    
78			"Pid =~ 6",                                                    // number instead of regexp
                    
79			"NIL",                                                         // invalid use of constant
                    
145			"Type == 'foo' || Type == 'bar' || Type == 'TEST'",
                    
146			fmt.Sprintf("Uuid == '%s'", uuidStr),
                    
147			"Fields[foo] == 'bar'",
                    
                
analytics.go https://gitlab.com/jjae2124/tyk | Go | 238 lines
                    
89type NormaliseURLPatterns struct {
                    
90	UUIDs  *regexp.Regexp
                    
91	IDs    *regexp.Regexp
                    
91	IDs    *regexp.Regexp
                    
92	Custom []*regexp.Regexp
                    
93}
                    
97
                    
98	uuidPat, pat1Err := regexp.Compile("[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}")
                    
99	if pat1Err != nil {
                    
107
                    
108	custPats := []*regexp.Regexp{}
                    
109	for _, pattern := range config.AnalyticsConfig.NormaliseUrls.Custom {
                    
117
                    
118	thesePatterns.UUIDs = uuidPat
                    
119	thesePatterns.IDs = numPat
                    
                
downward_api.go https://gitlab.com/github-cloud-corporation/bootkube | Go | 211 lines
                    
33	It("should provide pod name and namespace as env vars [Conformance]", func() {
                    
34		podName := "downward-api-" + string(util.NewUUID())
                    
35		env := []api.EnvVar{
                    
64	It("should provide pod IP as an env var", func() {
                    
65		podName := "downward-api-" + string(util.NewUUID())
                    
66		env := []api.EnvVar{
                    
85	It("should provide container's limits.cpu/memory and requests.cpu/memory as env vars", func() {
                    
86		podName := "downward-api-" + string(util.NewUUID())
                    
87		env := []api.EnvVar{
                    
131	It("should provide default limits.cpu/memory from node capacity", func() {
                    
132		podName := "downward-api-" + string(util.NewUUID())
                    
133		env := []api.EnvVar{
                    
209func testDownwardAPIUsingPod(f *framework.Framework, pod *api.Pod, env []api.EnvVar, expectations []string) {
                    
210	f.TestContainerOutputRegexp("downward api env vars", pod, 0, expectations)
                    
211}
                    
                
search.go https://gitlab.com/tamasd/ab | Go | 268 lines
                    
72
                    
73var searchSplitRegex = regexp.MustCompile(`[^\.\w]+`)
                    
74
                    
126		WITH
                    
127			uuids AS (SELECT uuid, SUM(relevance) rel FROM search_metadata WHERE keyword IN (`+placeholders+`) GROUP BY uuid),
                    
128			types AS (SELECT DISTINCT uuid, type, owner FROM search_metadata)
                    
128			types AS (SELECT DISTINCT uuid, type, owner FROM search_metadata)
                    
129		SELECT t.uuid, t.type FROM uuids u NATURAL JOIN types t WHERE u.rel > 0 `+ownerCheck+` ORDER BY u.rel DESC
                    
130	`, append(util.StringSliceToInterfaceSlice(keywords), util.StringSliceToInterfaceSlice(owners)...)...)
                    
146		matches = append(matches, d)
                    
147		uuids[d.Type] = append(uuids[d.Type], d.UUID)
                    
148	}
                    
248		CREATE TABLE search_metadata (
                    
249			uuid uuid NOT NULL,
                    
250			type character varying NOT NULL,
                    
                
rkt_exec_test.go https://gitlab.com/github-cloud-corporation/rkt | Go | 98 lines
                    
46		rktCmd        string
                    
47		expectedRegex string
                    
48	}{
                    
51			rktCmd:        fmt.Sprintf("%s --insecure-options=image run --mds-register=false %s -- --print-exec", ctx.Cmd(), execImage),
                    
52			expectedRegex: "inspect execed as: /inspect",
                    
53		},
                    
70	} {
                    
71		runRktAndCheckRegexOutput(t, tt.rktCmd, tt.expectedRegex)
                    
72	}
                    
84	rktCmd = fmt.Sprintf("%s prepare --insecure-options=image %s -- --print-exec", ctx.Cmd(), execImage)
                    
85	uuid = runRktAndGetUUID(t, rktCmd)
                    
86
                    
92	rktCmd = fmt.Sprintf("%s prepare --insecure-options=image %s --exec /inspect-link -- --print-exec", ctx.Cmd(), execImage)
                    
93	uuid = runRktAndGetUUID(t, rktCmd)
                    
94
                    
                
resource_cloudstack_egress_firewall.go https://gitlab.com/biopandemic/terraform.git | Go | 508 lines
                    
128	cs := meta.(*cloudstack.CloudStackClient)
                    
129	uuids := rule["uuids"].(map[string]interface{})
                    
130
                    
151		uuids["icmp"] = r.Id
                    
152		rule["uuids"] = uuids
                    
153	}
                    
320				"protocol":    "N/A",
                    
321				"uuids":       uuids,
                    
322			}
                    
403	cs := meta.(*cloudstack.CloudStackClient)
                    
404	uuids := rule["uuids"].(map[string]interface{})
                    
405
                    
433	// Update the UUIDs
                    
434	rule["uuids"] = uuids
                    
435
                    
                
regexes.go https://gitlab.com/kingwill101/palaceapi | 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)
                    
52	aSCIIRegex          = regexp.MustCompile(aSCIIRegexString)
                    
53	printableASCIIRegex = regexp.MustCompile(printableASCIIRegexString)
                    
54	multibyteRegex      = regexp.MustCompile(multibyteRegexString)
                    
                
downward_api.go https://gitlab.com/CORP-RESELLER/kubernetes | Go | 211 lines
                    
23	"k8s.io/kubernetes/pkg/api/resource"
                    
24	"k8s.io/kubernetes/pkg/util/uuid"
                    
25	"k8s.io/kubernetes/test/e2e/framework"
                    
33	It("should provide pod name and namespace as env vars [Conformance]", func() {
                    
34		podName := "downward-api-" + string(uuid.NewUUID())
                    
35		env := []api.EnvVar{
                    
64	It("should provide pod IP as an env var", func() {
                    
65		podName := "downward-api-" + string(uuid.NewUUID())
                    
66		env := []api.EnvVar{
                    
85	It("should provide container's limits.cpu/memory and requests.cpu/memory as env vars", func() {
                    
86		podName := "downward-api-" + string(uuid.NewUUID())
                    
87		env := []api.EnvVar{
                    
131	It("should provide default limits.cpu/memory from node capacity", func() {
                    
132		podName := "downward-api-" + string(uuid.NewUUID())
                    
133		env := []api.EnvVar{
                    
                
 

Source

Language