All
Go
Java
Javascript
Php
Python
Ruby
protected static String orRegex(Iterable<String> elements) {
		final StringBuilder regex = new StringBuilder();
		for (final String element : elements) {
			if (regex.length() > 0) {
				regex.append("|"); //$NON-NLS-1$
			}
			regex.append("(?:"); //$NON-NLS-1$
			regex.append(quoteRegex(element));
			regex.append(")"); //$NON-NLS-1$
		}
		return regex.toString();
	}
2.
phmLabs/Smoke · RegExExistsRule.php
Match rating: 53.31% · See similar code snippets
php logo
public function init(array $regExs)
    {
        $regExArray = array();

        foreach ($regExs as $regEx) {
            if (array_key_exists('regex', $regEx)) {
                $isRegex = $regEx['isRegex'] == 'on';
                $regExArray[] = ['pattern' => $regEx['regex'], 'isRegEx' => $isRegex];
            } else {
                $regExArray[] = $regEx;
            }
        }

        $this->regExs = $regExArray;
    }
3.
java logo
public Optional<Boolean> match(String user, String property)
    {
        if (userRegex.map(regex -> regex.matcher(user).matches()).orElse(true) &&
                propertyRegex.map(regex -> regex.matcher(property).matches()).orElse(true)) {
            return Optional.of(allow);
        }
        return Optional.empty();
    }
4.
fuelphp/routing · Parameter.php
Match rating: 51.58% · See similar code snippets
php logo
public function getRegex()
	{
		$regex = '(?P<'.$this->name.'>'.$this->regex.')';

		if ($this->optional)
		{
			$regex = '(?:'.$regex.')?';
		}

		return $regex;
	}
5.
samurai-fw/samurai · GlobExpression.php
Match rating: 51.54% · See similar code snippets
php logo
public function getRegexPattern()
    {
        $regex = preg_quote($this->value, '/');
        $regex = substr($regex, -1) !== '*' ? $regex . '$' : $regex;
        $regex = preg_replace('/\\\\\\*/', '.*?', $regex);
        return "/^{$regex}/";
    }
6.
Match rating: 51.36% · See similar code snippets
php logo
private function _getLikeRegex($string)
  {
    $regex = preg_quote($string, '/');
    $regex = preg_replace('/(?<!\\\\)%/', '.*?', $regex);
    $regex = str_replace('\\\\%', '\\%', $regex);
    return '/^' . $regex . '$/';
  }
7.
toberkoe/fluent-assertions · StringAssert.java
Match rating: 51.27% · See similar code snippets
java logo
public StringAssert matches(String regex) {
        if (test(s -> s.matches(regex))) {
            return this;
        }

        throw error("Expected %s to match regex %s", value, regex);
    }
8.
src-d/go-git · section.go
Match rating: 51.22% · See similar code snippets
go logo
func (s *Section) IsName(name string) bool {
	return strings.ToLower(s.Name) == strings.ToLower(name)
}
9.
rythmengine/rythmengine · CodeBuilder.java
Match rating: 51.02% · See similar code snippets
java logo
@SuppressWarnings("unused")
    private static boolean isArray(String type) {
        Regex regex = new Regex(".*(?@[])");
        return regex.search(type);
    }
10.
Impetus/Kundera · MongoDBQuery.java
Match rating: 50.96% · See similar code snippets
java logo
public static String createLikeRegex(String expr, boolean ignoreCase)
    {
        String regex = createRegex(expr, ignoreCase);
        regex = regex.replace("_", ".").replace("%", ".*?");

        return regex;
    }
11.
Chorus-bdd/Chorus · ConfigPropertyUtils.java
Match rating: 50.75% · See similar code snippets
java logo
public static <T extends Enum<T>> Pattern createValidationPatternFromEnumType(Class<T> enumType) {

        String regEx = Stream.of(enumType.getEnumConstants())
                .map(Enum::name)
                .collect(Collectors.joining("|", "(?i)", ""));

        //Enum constants may contain $ which needs to be escaped
        regEx = regEx.replace("$", "\\$");
        return Pattern.compile(regEx);
    }
12.
OpenTSDB/opentsdb · TreeRule.java
Match rating: 50.68% · See similar code snippets
java logo
public void setRegex(String regex) {
    if (!this.regex.equals(regex)) {
      changed.put("regex", true);
      this.regex = regex;
      if (regex != null && !regex.isEmpty()) {
        this.compiled_regex = Pattern.compile(regex);
      } else {
        this.compiled_regex = null;
      }
    }
  }
13.
greg-md/php-router · RouteUtils.php
Match rating: 50.29% · See similar code snippets
php logo
private static function paramFetchRegex(string $regex): string
    {
        if ($regex === '*') {
            return '.+?';
        }

        $regex = Regex::disableGroups($regex);

        if ($regex[-1] == '+' or $regex[-1] == '*') {
            $regex .= '?';
        }

        return $regex;
    }
14.
poetix/navn · Name.java
Match rating: 50.1% · See similar code snippets
java logo
public static Name of(String source, String regex) {
        return of(source, s -> s.split(regex));
    }
15.
TeaLabs/uzi · Str.php
Match rating: 50.06% · See similar code snippets
php logo
public function matches($pattern, $caseSensitive = true)
	{
		$regex = $this->toRegex($pattern, ($caseSensitive ? "" : Modifiers::CASELESS ));

		return $regex->matches($this);
	}
16.
budkit/budkit-framework · Route.php
Match rating: 50.04% · See similar code snippets
php logo
protected function isServerMatchRegex($server, $name, $regex)
    {
        $value = isset($server[$name])
            ? $server[$name]
            : '';
        $regex = "#(?P<{$name}>{$regex})#";
        preg_match($regex, $value, $matches);

        return $matches;
    }
17.
hunzhiwange/framework · Dispatch.php
Match rating: 49.97% · See similar code snippets
php logo
protected function prepareRegexForWildcard(string $regex): string
    {
        $regex = preg_quote($regex, '/');
        $regex = '/^'.str_replace('\*', '(\S*)', $regex).'$/';

        return $regex;
    }
18.
craftercms/commons · RegexUtils.java
Match rating: 49.78% · See similar code snippets
java logo
public static boolean matchesAny(String str, List<String> regexes, boolean fullMatch) {
        if (CollectionUtils.isNotEmpty(regexes)) {
            for (String regex : regexes) {
                Pattern pattern = Pattern.compile(regex);
                Matcher matcher = pattern.matcher(str);

                if (fullMatch) {
                    if (matcher.matches()) {
                        return true;
                    }
                } else {
                    if (matcher.find()) {
                        return true;
                    }
                }
            }
        }

        return false;
    }
19.
phapi/middleware-route · RouteParser.php
Match rating: 49.46% · See similar code snippets
php logo
public function parse($route)
    {
        // reset param names
        $this->paramNames = [];

        // replace shortcuts
        $regex = strtr($route, $this->shortcuts);

        // replace param names that doesn't include shortcuts or regex
        $regex = preg_replace_callback('/{([a-zA-Z0-9]+)}/', [$this, 'replaceWithoutRegex'], $regex);

        // replace param names that includes shortcuts or regex
        $regex = preg_replace_callback('/{([a-zA-Z0-9]+):/', [$this, 'replaceWithRegex'], $regex);

        // replace ending grouping
        $regex = str_replace('}', ')', $regex);

        // fix slashes when optional params are present
        $regex = $this->fixOptionalSlashes($regex);

        // fix for handling trailing slashes
        $regex .= '(/)?';

        // return regex and param names
        return ['#^'. $regex .'$#', $this->paramNames];
    }
20.
i-am-tom/schemer · Text.php
Match rating: 49.46% · See similar code snippets
php logo
public function regex(string $regex) : Text
    {
        return $this->pipe(
            self::predicate(
                function ($value) use ($regex) {
                    return preg_match($regex, $value) === 1;
                },
                "does not match $regex"
            )
        );
    }
21.
lightblue-platform/lightblue-client · Query.java
Match rating: 49.43% · See similar code snippets
java logo
public static Query withMatchingString(String field, String value, boolean caseInsensitive) {
        return caseInsensitive ? regex(field, escapeRegExPattern(value), caseInsensitive, false, false, false) : withValue(field, eq, value);
    }
22.
jonathanlarsen/node-otter-routes · file.js
Match rating: 49.03% · See similar code snippets
javascript logo
function (method) {
            var regex = new RegExp('^' + method, 'i');
            var m = controllerName.match(regex);
            if (m) {
                match = m[0].toLowerCase();
                return true;
            }
            return false;
        }
23.
honeycombio/honeytail · regex.go
Match rating: 48.92% · See similar code snippets
go logo
func ParseLineRegexes(regexStrs []string) ([]*regexp.Regexp, error) {
	regexes := make([]*regexp.Regexp, 0)
	for _, regexStr := range regexStrs {
		regex, err := ParseLineRegex(regexStr)
		if err != nil {
			return regexes, err
		}
		regexes = append(regexes, regex)
	}
	return regexes, nil
}
24.
kubernetes/gengo · namer.go
Match rating: 48.43% · See similar code snippets
go logo
func (ns *NameStrategy) removePrefixAndSuffix(s string) string {
	// The join function may have changed capitalization.
	lowerIn := strings.ToLower(s)
	lowerP := strings.ToLower(ns.Prefix)
	lowerS := strings.ToLower(ns.Suffix)
	b, e := 0, len(s)
	if strings.HasPrefix(lowerIn, lowerP) {
		b = len(ns.Prefix)
	}
	if strings.HasSuffix(lowerIn, lowerS) {
		e -= len(ns.Suffix)
	}
	return s[b:e]
}
25.
cloud-custodian/cloud-custodian · core.py
Match rating: 48.32% · See similar code snippets
python logo
def regex_case_sensitive_match(value, regex):
    if not isinstance(value, six.string_types):
        return False
    # Note python 2.5+ internally cache regex
    # would be nice to use re2
    return bool(re.match(regex, value))
26.
favclip/qbg · generator.go
Match rating: 48.13% · See similar code snippets
go logo
func (st *BuildStruct) Name() string {
	// FooBar -> fooBar
	// IIS -> iis
	// AEData -> aeData

	name := st.SimpleName()

	if !st.Private {
		return name
	}
	if len(name) <= 1 {
		return strings.ToLower(name)
	}
	if name == strings.ToUpper(name) {
		return strings.ToLower(name)
	}

	runeNames := []rune(name)
	if unicode.IsLower(runeNames[0]) {
		return name
	} else if unicode.IsLower(runeNames[1]) {
		return string(unicode.ToLower(runeNames[0])) + string(runeNames[1:])
	}

	var idx int
	for idx = 0; idx < len(runeNames); idx++ {
		r := runeNames[idx]
		if unicode.IsLower(r) {
			break
		}
	}

	return strings.ToLower(string(runeNames[0:idx-1])) + string(runeNames[idx-1:])
}
27.
s-yadav/jsonQ · jsonQ.js
Match rating: 48.13% · See similar code snippets
javascript logo
function matchPath(a, b) {
        var regex = new RegExp('^' + a.join('~~'), 'i');
        return regex.test(b.join('~~'));
    }
28.
RudolfCardinal/pythonlib · sql_grammar.py
Match rating: 48.12% · See similar code snippets
python logo
def make_pyparsing_regex(regex_str: str,
                         caseless: bool = False,
                         name: str = None) -> Regex:
    flags = re.IGNORECASE if caseless else 0
    result = Regex(regex_str, flags=flags)
    if name:
        result.setName(name)
    return result
29.
revel/revel · validation.go
Match rating: 48.05% · See similar code snippets
go logo
func (v *Validation) Match(str string, regex *regexp.Regexp) *ValidationResult {
	return v.apply(Match{regex}, str)
}
30.
RudolfCardinal/pythonlib · sql_grammar.py
Match rating: 47.8% · See similar code snippets
python logo
def sql_keyword(word: str) -> Regex:
    regex_str = word_regex_element(word)
    return make_pyparsing_regex(regex_str, caseless=True, name=word)
31.
cltk/cltk · query.py
Match rating: 47.79% · See similar code snippets
python logo
def _regex_span(_regex, _str, case_insensitive=True):
    """Return all matches in an input string.
    :rtype : regex.match.span
    :param _regex: A regular expression pattern.
    :param _str: Text on which to run the pattern.
    """
    if case_insensitive:
        flags = regex.IGNORECASE | regex.FULLCASE | regex.VERSION1
    else:
        flags = regex.VERSION1
    comp = regex.compile(_regex, flags=flags)
    matches = comp.finditer(_str)
    for match in matches:
        yield match
32.
shurcooL/graphql · ident.go
Match rating: 47.78% · See similar code snippets
go logo
func (n Name) ToLowerCamelCase() string {
	for i, word := range n {
		if i == 0 {
			n[i] = strings.ToLower(word)
			continue
		}
		r, size := utf8.DecodeRuneInString(word)
		n[i] = string(unicode.ToUpper(r)) + strings.ToLower(word[size:])
	}
	return strings.Join(n, "")
}
33.
kubernetes-incubator/external-storage · aws.go
Match rating: 47.74% · See similar code snippets
go logo
func (c *Cloud) getInstancesByRegex(regex string) ([]types.NodeName, error) {
	filters := []*ec2.Filter{newEc2Filter("instance-state-name", "running")}

	instances, err := c.describeInstances(filters)
	if err != nil {
		return []types.NodeName{}, err
	}

	if len(instances) == 0 {
		return []types.NodeName{}, fmt.Errorf("no instances returned")
	}

	if strings.HasPrefix(regex, "'") && strings.HasSuffix(regex, "'") {
		glog.Infof("Stripping quotes around regex (%s)", regex)
		regex = regex[1 : len(regex)-1]
	}

	re, err := regexp.Compile(regex)
	if err != nil {
		return []types.NodeName{}, err
	}

	matchingInstances := []types.NodeName{}
	for _, instance := range instances {
		// Only return fully-ready instances when listing instances
		// (vs a query by name, where we will return it if we find it)
		if orEmpty(instance.State.Name) == "pending" {
			glog.V(2).Infof("Skipping EC2 instance (pending): %s", *instance.InstanceId)
			continue
		}

		nodeName := mapInstanceToNodeName(instance)
		if nodeName == "" {
			glog.V(2).Infof("Skipping EC2 instance (no PrivateDNSName): %s",
				aws.StringValue(instance.InstanceId))
			continue
		}

		for _, tag := range instance.Tags {
			if orEmpty(tag.Key) == "Name" && re.MatchString(orEmpty(tag.Value)) {
				matchingInstances = append(matchingInstances, nodeName)
				break
			}
		}
	}
	glog.V(2).Infof("Matched EC2 instances: %s", matchingInstances)
	return matchingInstances, nil
}
34.
mcs07/ChemDataExtractor · selector.py
Match rating: 47.49% · See similar code snippets
python logo
def re(self, regex):
        if isinstance(regex, six.string_types):
            regex = re.compile(regex, re.U)
        text = self.extract()
        return flatten(regex.findall(text))
35.
cespare/reflex · match.go
Match rating: 47.48% · See similar code snippets
go logo
func newRegexMatcher(regex *regexp.Regexp, inverse bool) *regexMatcher {
	return &regexMatcher{
		regex:   regex,
		inverse: inverse,
		mu:      new(sync.Mutex),
	}
}
36.
keybase/client · utils.go
Match rating: 47.42% · See similar code snippets
go logo
func GetQueryRe(query string) (*regexp.Regexp, error) {
	return regexp.Compile("(?i)" + regexp.QuoteMeta(query))
}
37.
atsuoishimoto/tse · main.py
Match rating: 47.4% · See similar code snippets
python logo
def build_re(self, regex):
        if not regex:
            regex = '.*'
        flags = re.I if self.ignore_case else 0
        return re.compile(regex, flags)
38.
candreoliveira/ngMask · ngMask.js
Match rating: 47.15% · See similar code snippets
javascript logo
function getRegex(index) {
          var currentRegex;

          try {
            currentRegex = regex[index] ? regex[index].source : '';
          } catch (e) {
            throw e;
          }

          return (new RegExp('^' + currentRegex + '$'));
        }
39.
olebedev/when · casual_date.go
Match rating: 47.11% · See similar code snippets
go logo
func regexContains(regex string, text string) bool {
	contains, _ := regexp.MatchString(regex, text)

	return contains
}
40.
wolfhong/formic · formic.py
Match rating: 46.92% · See similar code snippets
python logo
def match(self, string):
        """Returns True if the argument matches the constant."""
        if self.casesensitive:
            return self.pattern == os.path.normcase(string)
        else:
            return self.pattern.lower() == os.path.normcase(string).lower()
41.
evfredericksen/pynacea · matching.py
Match rating: 46.67% · See similar code snippets
python logo
def get_rule_match(rule, words, filter_list=None):
    if filter_list is None:
        filter_list = []
    filtered_positions = utilities.get_filtered_positions(words, filter_list)
    words = [word.lower() for word in words if word not in filter_list]
    regex_match = rule.compiled_regex.match(' '.join(words) + ' ')
    if regex_match is not None:
        raw_results = regex_match.group()
        group_dict = regex_match.groupdict()
        matched = replace_values(regex_match, group_dict, rule.groups)
        nums = get_numbers(regex_match, group_dict, rule.groups)
        if len(raw_results) > len(' '.join(words)):
            remaining_words = []
        else:
            remaining_words = ' '.join(words)[len(raw_results):].split()
        remaining_words = utilities.reinsert_filtered_words(
            remaining_words, filtered_positions)
        return RuleMatch(rule, matched, remaining_words, nums)
42.
maxkueng/viewportsizes · index.js
Match rating: 46.63% · See similar code snippets
javascript logo
function list (search) {
	if (!search) {
		return sizes;
	}

	var regex = new RegExp(search, 'i');

	return sizes.filter(function (item) {
		return regex.test(item.fulltext)
	});
}
43.
SamVerschueren/string-occurrence · index.js
Match rating: 46.46% · See similar code snippets
javascript logo
function (input, search, opts) {
	if (typeof input !== 'string') {
		throw new TypeError('The input should be a string');
	}

	opts = opts || {caseInsensitive: true};

	var flags = 'g';

	if (opts.caseInsensitive === true) {
		flags += 'i';
	}

	return regexOccurrence(input, [].concat(search).map(function (search) {
		return new RegExp(escape(search), flags);
	}));
}
44.
rossant/ipymd · prompt.py
Match rating: 46.29% · See similar code snippets
python logo
def _starts_with_regex(line, regex):
    """Return whether a line starts with a regex or not."""
    if not regex.startswith('^'):
        regex = '^' + regex
    reg = re.compile(regex)
    return reg.match(line)
45.
cobrateam/flask-mongoalchemy · documents.py
Match rating: 46.19% · See similar code snippets
python logo
def starting_with(self, letter):
        regex = r'^' + letter
        return self.filter({'title': re.compile(regex, re.IGNORECASE)})
46.
vbarzokas/greek-utils · index.js
Match rating: 45.69% · See similar code snippets
javascript logo
function (characters) {
			regexString = exactMatch ? characters.find : '[' + characters.find + ']';
			if (ignore) { regexString = '(?![' + ignore + '])' + regexString; }
			regex = new RegExp(regexString, 'g');
			text = text.replace(regex, characters.replace);
		}
47.
ilyabogdanov/zen-ui-angularjs · components.js
Match rating: 45.35% · See similar code snippets
javascript logo
function () {
        return function(input, filterString, textParam) {
            if (!filterString) {
                return input;
            }
            filterString = ".*" + filterString.toLowerCase().split(" ").join(".*");
            var regex = new RegExp(filterString, 'i'), output = [];
            angular.forEach(input, function(item) {
                if (regex.test(item[textParam])) {
                    output.push(item);
                }
            });
            return output;
        };
    }
48.
bbusschots-mu/mu-qunit-util · index.es.js
Match rating: 45.16% · See similar code snippets
javascript logo
function regexpCheck(regexp, regexes) {
        is[regexp] = function(value) {
            return regexes[regexp].test(value);
        };
    }
49.
thebuilder/react-docs-markdown · index.js
Match rating: 45.01% · See similar code snippets
javascript logo
function toRegExp(input) {
  if (!input) return null
  if (Array.isArray(input)) return new RegExp(`(${input.join('|')})`, 'i')

  return new RegExp(input, 'i')
}
50.
alexfernandez/prototypes · string.js
Match rating: 44.81% · See similar code snippets
javascript logo
function(find, replace)
{
	if (util.isRegExp(find))
	{
		return this.replace(find.addOptions('i'), replace);
	}
	if (typeof find != 'string')
	{
		return null;
	}
	if (!this.containsIgnoreCase(find)) return this;
	var newCase = new RegExp(find, 'i');
	return this.replace(newCase, replace);
}
51.
Shopify/liquid · standardfilters.rb
Match rating: 41.55% · See similar code snippets
ruby logo
def nil_safe_casecmp(a, b)
      if !a.nil? && !b.nil?
        a.to_s.casecmp(b.to_s)
      else
        a.nil? ? 1 : -1
      end
    end
52.
sup-heliotrope/sup · scroll_mode.rb
Match rating: 40.84% · See similar code snippets
ruby logo
def find_text query, start_line
    regex = /#{query}/i
    (start_line ... lines).each do |i|
      case(s = self[i])
      when String
        match = s =~ regex
        return [i, match] if match
      when Array
        offset = 0
        s.each do |color, string|
          match = string =~ regex
          if match
            return [i, offset + match]
          else
            offset += string.display_length
          end
        end
      end
    end
    nil
  end
53.
halogenandtoast/timelord · matcher_loader.rb
Match rating: 39.82% · See similar code snippets
ruby logo
def sort_matchers(matchers)
      matchers.sort { |a, b| b::REGEX.to_s.length <=> a::REGEX.to_s.length }
    end
54.
mjacobus/semistatic · page.rb
Match rating: 38.88% · See similar code snippets
ruby logo
def part(name)
      parts.select {|p| p.name.downcase == name.to_s.downcase }.first
    end
55.
dfhoughton/list_matcher · list_matcher.rb
Match rating: 38.65% · See similar code snippets
ruby logo
def pattern( list, opts={} )
      return '(?!)' unless list.any?
      return bud(opts).pattern list unless opts.empty?
      list = list.compact.map(&:to_s).select{ |s| s.length > 0 }
      list.map!(&:strip).select!{ |s| s.length > 0 } if strip
      list.map!{ |s| s.gsub %r/\s++/, ' ' } if normalize_whitespace
      return nil if list.empty?
      specializer = Special.new self, @symbols, list
      list = specializer.normalize

      root = tree list, specializer
      root.root = true
      root.flatten
      rx = root.convert
      if m = modifiers
        rx = "(?#{m}:#{rx})"
        grouped = true
      end
      if name
        rx = "(?<#{name}>#{rx})"
        grouped = true
      end
      return rx if grouped && backtracking
      if atomic && !root.atomic?
        wrap rx
      else
        rx
      end
    end
56.
diasks2/pragmatic_tokenizer · post_processor.rb
Match rating: 38.52% · See similar code snippets
ruby logo
def call
      text
          .split
          .map      { |token| convert_sym_to_punct(token) }
          .flat_map { |token| token.split(Regex::COMMAS_OR_PUNCTUATION) }
          .flat_map { |token| token.split(Regex::VARIOUS) }
          .flat_map { |token| token.split(Regex::ENDS_WITH_PUNCTUATION2) }
          .flat_map { |token| split_dotted_email_or_digit(token) }
          .flat_map { |token| split_abbreviations(token) }
          .flat_map { |token| split_period_after_last_word(token) }
    end
57.
diasks2/pragmatic_tokenizer · tokenizer.rb
Match rating: 37.94% · See similar code snippets
ruby logo
def process_numbers!
        case @numbers
        when :semi
          @tokens.delete_if { |token| token =~ Regex::ONLY_DECIMALS }
        when :none
          @tokens.delete_if { |token| token =~ Regex::NO_DECIMALS_NO_NUMERALS }
        when :only
          @tokens.delete_if { |token| token =~ Regex::NO_DECIMALS }
        end
      end
58.
axsh/isono · util.rb
Match rating: 37.59% · See similar code snippets
ruby logo
def snake_case(str)
      return str.downcase if str.match(/\A[A-Z]+\z/)
      str.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
        gsub(/([a-z])([A-Z])/, '\1_\2').
        downcase
    end
59.
erector/erector · tag.rb
Match rating: 37.57% · See similar code snippets
ruby logo
def snake_case(s)
      if s.match(/\A[A-Z]+\z/)
        s.downcase
      else
        s.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
         gsub(/([a-z])([A-Z])/, '\1_\2').
         downcase
      end
    end
60.
enspirit/webspicy · scope.rb
Match rating: 37.56% · See similar code snippets
ruby logo
def to_real_url(url, test_case = nil, &bl)
      case config.host
      when Proc
        config.host.call(url, test_case)
      when String
        url =~ /^http/ ? url : "#{config.host}#{url}"
      else
        return url if url =~ /^http/
        return yield(url) if block_given?
        raise "Unable to resolve `#{url}` : no host resolver provided\nSee `Configuration#host="
      end
    end