Finds element using xPath, supporting placeholder replacement.
@param pattern basic XPATH, possibly with placeholders.
@param parameters values for placeholders.
@return element if found, null if none could be found.
505209
public T findByXPath(String pattern, String... parameters) {
        By by = byXpath(pattern, parameters);
        return findElement(by);
    }
1325644
function (pattern, options) {
    var self = this;
    function find() {
      var isMatch = lazy.mm.matcher(pattern, options);
      for (var key in self) {
        var val = self[key];
        if (typeof val === 'object' && isMatch(key)) {
          return val;
        }
      }
    }
    var res = this.fragmentCache(pattern, find);
    res.__proto__ = this;
    return res;
  }
734980
public static IllegalArgumentException IllegalArgument(String pattern,
            Object... parameters) {
        return strip(new IllegalArgumentException(String.format(pattern,
                parameters)));
    }
693385
public static PatternMatcher compile(String pattern) {
    String p = pattern;
    boolean ignoreCase = false;
    if (p.startsWith("(?i)")) {
      ignoreCase = true;
      p = pattern.substring(4);
    }
    if (p.length() > 0) {
      p = "^.*(" + p + ").*$";
    }
    Parser parser = new Parser(PatternUtils.expandEscapedChars(p));
    Matcher m = Optimizer.optimize(parser.parse());
    return ignoreCase ? m.ignoreCase() : m;
  }
989590
public static List<Match> searchPlain(Collection<? extends BioPAXElement> eles, Pattern pattern)
	{
		List<Match> list = new LinkedList<Match>();

		Map<BioPAXElement, List<Match>> map = search(eles, pattern);
		for (List<Match> matches : map.values())
		{
			list.addAll(matches);
		}
		return list;
	}
79987
function (pattern) {
            var scripts = Aria.$frameworkWindow.document.getElementsByTagName("script");
            for (var i = 0, l = scripts.length; i < l; i++) {
                var script = scripts[i];
                if (script.attributes && script.attributes["src"]) {
                    var src = script.attributes["src"].nodeValue;
                    if (pattern.exec(src)) {
                        return src;
                    }
                }
            }
            this.$logError("Could not find the script corresponding to pattern: %1. Please set the aria.jsunit.FrameATLoader.frameworkHref property manually.");
            return null;
        }
79538
public HString findPattern(@NonNull Pattern regex) {
      Matcher m = matcher(regex);
      if (m.find()) {
         return union(substring(m.start(), m.end()).tokens());
      }
      return Fragments.empty(document());
   }
82001
public function matchPattern(string $pattern) : Element
    {
        $this->attributes['pattern'] = $pattern;
        return $this->addTest('pattern', function ($value) use ($pattern) {
            return preg_match("@^$pattern$@", trim($value));
        });
    }
238166
public MarkupText.SubText findToken(Pattern pattern) {
        String text = getText();
        Matcher m = pattern.matcher(text);

        if(m.find())
            return createSubText(m);

        return null;
    }
883350
@Nonnull
	public DataBuilder appendBrowserPattern(@Nonnull final BrowserPattern pattern) {
		Check.notNull(pattern, "pattern");
		if (!browserPatterns.containsKey(pattern.getId())) {
			browserPatterns.put(pattern.getId(), new TreeSet<BrowserPattern>(BROWSER_PATTERN_COMPARATOR));
		}

		browserPatterns.get(pattern.getId()).add(pattern);
		return this;
	}
952094
public static String regexFindFirst(String pattern, String str) {
    return regexFindFirst(Pattern.compile(pattern), str, 1);
  }
1135711
protected Pattern compilePattern(Element regex, int flags) {

		Pattern p = null;
		try {
			String re = ((StringProperty) regex).getValue();
			p = Pattern.compile(re, flags);
		} catch (PatternSyntaxException pse) {
			throw EvaluationException.create(sourceRange, MSG_INVALID_REGEXP,
					pse.getLocalizedMessage());
		}

		return p;
	}
550023
static Tuple2<String, String> doParseAndGetPattern(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
		String id = Check.ifNullOrBlank(element.getAttribute("id"), UUID.randomUUID().toString());
		String pattern = element.getTextContent();
		Sitemap.registerPattern(id, pattern, parserContext);
		return new Tuple2<String, String>(id, pattern);
	}
310907
protected List<Object> filterAttributeValuesByPattern(final Set<Object> attributeValues, final Pattern pattern) {
        return attributeValues.stream().filter(v -> RegexUtils.matches(pattern, v.toString(), completeMatch)).collect(Collectors.toList());
    }
1172877
public static SimonPattern create(String pattern) {
		if (pattern == null) {
			return null;
		}

		return createForType(pattern, Simon.class);
	}
545883
public synchronized String format(final String pattern, final Object... args) {
		Map<String, Object> model = Collections.emptyMap();
		ModelAdaptor modelAdaptor = new ModelAdaptor() {

			@Override
			public Object getValue(TemplateContext context, Token token, List<String> segments, String expression) {
				int index = Integer.parseInt(expression) - 1;
				return args[index];
			}

            @Override
            public Iterable<Object> getIterable(Object value) {
                return null;
            }

            @Override
            public String getSpecialIteratorVariable() {
                return null;
            }

        };

		String output = transformInternal(pattern, null, model, modelAdaptor, null);
		return output;
	}
938981
public static void i(String tag, String pattern, Object... parameters) {
        i(SUBSYSTEM.MAIN, tag, pattern, parameters);
    }