Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 22 for FindSubmatch (0.24 sec)

  1. src/cmd/vendor/golang.org/x/mod/internal/lazyregexp/lazyre.go

    func (r *Regexp) re() *regexp.Regexp {
    	r.once.Do(r.build)
    	return r.rx
    }
    
    func (r *Regexp) build() {
    	r.rx = regexp.MustCompile(r.str)
    	r.str = ""
    }
    
    func (r *Regexp) FindSubmatch(s []byte) [][]byte {
    	return r.re().FindSubmatch(s)
    }
    
    func (r *Regexp) FindStringSubmatch(s string) []string {
    	return r.re().FindStringSubmatch(s)
    }
    
    func (r *Regexp) FindStringSubmatchIndex(s string) []int {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jul 12 20:38:21 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  2. src/internal/lazyregexp/lazyre.go

    func (r *Regexp) re() *regexp.Regexp {
    	r.once.Do(r.build)
    	return r.rx
    }
    
    func (r *Regexp) build() {
    	r.rx = regexp.MustCompile(r.str)
    	r.str = ""
    }
    
    func (r *Regexp) FindSubmatch(s []byte) [][]byte {
    	return r.re().FindSubmatch(s)
    }
    
    func (r *Regexp) FindStringSubmatch(s string) []string {
    	return r.re().FindStringSubmatch(s)
    }
    
    func (r *Regexp) FindStringSubmatchIndex(s string) []int {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 27 23:49:01 UTC 2019
    - 1.8K bytes
    - Viewed (0)
  3. src/internal/cpu/cpu_s390x_test.go

    	"testing"
    )
    
    func getFeatureList() ([]string, error) {
    	cpuinfo, err := os.ReadFile("/proc/cpuinfo")
    	if err != nil {
    		return nil, err
    	}
    	r := regexp.MustCompile("features\\s*:\\s*(.*)")
    	b := r.FindSubmatch(cpuinfo)
    	if len(b) < 2 {
    		return nil, errors.New("no feature list in /proc/cpuinfo")
    	}
    	return regexp.MustCompile("\\s+").Split(string(b[1]), -1), nil
    }
    
    func TestS390XAgainstCPUInfo(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Dec 09 19:12:23 UTC 2020
    - 1.4K bytes
    - Viewed (0)
  4. tools/docker-builder/types.go

    		return b
    	}
    	b, err := os.ReadFile(filepath.Join(testenv.IstioSrc, "Makefile.core.mk"))
    	if err != nil {
    		log.Fatalf("failed to read file: %v", err)
    		return "unknown"
    	}
    	match := baseVersionRegexp.FindSubmatch(b)
    	if len(match) < 2 {
    		log.Fatalf("failed to find match")
    		return "unknown"
    	}
    	return string(match[1])
    }
    
    var istioVersionRegexp = regexp.MustCompile(`VERSION \?= (.*)`)
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Jul 26 13:23:41 UTC 2023
    - 9.9K bytes
    - Viewed (0)
  5. src/cmd/go/testdata/script/test_fuzz_minimize_interesting.txt

    		data, err := ioutil.ReadFile(filepath.Join(dir, f.Name()))
    		if err != nil {
    			panic(err)
    		}
    		var containsVal bool
    		for _, line := range bytes.Split(data, []byte("\n")) {
    			m := valRe.FindSubmatch(line)
    			if m == nil {
    				continue
    			}
    			containsVal = true
    			s, err := strconv.Unquote(string(m[1]))
    			if err != nil {
    				panic(err)
    			}
    			if len(s) != wantLen {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 05 23:35:32 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  6. src/cmd/go/testdata/script/test_fuzz_minimize_dirty_cov.txt

    )
    
    func checkFile(name, expected string) (bool, error) {
    	data, err := os.ReadFile(name)
    	if err != nil {
    		return false, err
    	}
    	for _, line := range bytes.Split(data, []byte("\n")) {
    		m := valRe.FindSubmatch(line)
    		if m == nil {
    			continue
    		}
    		fmt.Println(strconv.Unquote(string(m[1])))
    		if s, err := strconv.Unquote(string(m[1])); err != nil {
    			return false, err
    		} else if s == expected {
    			return true, nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 27 01:16:19 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  7. src/cmd/cgo/internal/swig/swig_test.go

    	if err != nil {
    		t.Skipf("failed to get swig version:%s\n%s", err, string(out))
    	}
    
    	re := regexp.MustCompile(`[vV]ersion +(\d+)([.]\d+)?([.]\d+)?`)
    	matches := re.FindSubmatch(out)
    	if matches == nil {
    		// Can't find version number; hope for the best.
    		t.Logf("failed to find swig version, continuing")
    		return
    	}
    
    	var parseError error
    	atoi := func(s string) int {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 12:38:14 UTC 2024
    - 4K bytes
    - Viewed (0)
  8. src/cmd/go/internal/work/init.go

    					// gcc, but does not support gcc's "-v" flag?!
    					return err
    				}
    				gccRE := regexp.MustCompile(`gcc version (\d+)\.(\d+)`)
    				match = gccRE.FindSubmatch(out)
    			} else {
    				clangRE := regexp.MustCompile(`clang version (\d+)\.(\d+)`)
    				if match = clangRE.FindSubmatch(out); len(match) > 0 {
    					compiler.name = "clang"
    				}
    			}
    
    			if len(match) < 3 {
    				return nil // "unknown"
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 28 19:13:34 UTC 2023
    - 12.2K bytes
    - Viewed (0)
  9. src/regexp/all_test.go

    	s := []byte("acbb" + wantSubs + "dd")
    	b.StartTimer()
    	b.ReportAllocs()
    	for i := 0; i < b.N; i++ {
    		subs := re.FindSubmatch(s)
    		if string(subs[0]) != wantSubs {
    			b.Fatalf("FindSubmatch(%q)[0] = %q; want %q", s, subs[0], wantSubs)
    		}
    		if string(subs[1]) != "aab" {
    			b.Fatalf("FindSubmatch(%q)[1] = %q; want %q", s, subs[1], "aab")
    		}
    	}
    }
    
    func BenchmarkFindStringSubmatch(b *testing.B) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:36:03 UTC 2024
    - 25.8K bytes
    - Viewed (0)
  10. src/cmd/cgo/internal/testsanitizers/cc_test.go

    					// gcc, but does not support gcc's "-v" flag?!
    					return err
    				}
    				gccRE := regexp.MustCompile(`(\d+)\.(\d+)`)
    				match = gccRE.FindSubmatch(out)
    			} else {
    				clangRE := regexp.MustCompile(`clang version (\d+)\.(\d+)`)
    				if match = clangRE.FindSubmatch(out); len(match) > 0 {
    					compiler.name = "clang"
    				}
    			}
    
    			if len(match) < 3 {
    				return nil // "unknown"
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 09 20:00:56 UTC 2024
    - 14.4K bytes
    - Viewed (0)
Back to top