Home >Backend Development >PHP Tutorial >Online regular expression matching test

Online regular expression matching test

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-08-08 09:28:142846browse

I’ve been learning regular expressions recently and I just happened to write an online php that matches regular expressions and share it with everyone~

<?php
//正则表达式学习系统
if($_POST[&#39;text&#39;])
{
	$str=$_POST[&#39;text&#39;];//file_get_contents("a.dat");
	preg_match_all(&#39;/&#39;.$_POST[&#39;reg&#39;].&#39;/&#39;,$str,$s);
	print_r($s);
}
?>
<meta charset="utf-8">
<title>Reg learning</title>
<link rel="stylesheet" href="/assets/css/amazeui.min.css">
<div class="am-g">
  <div class=" col-md-8 col-sm-centered">
    <form class="am-form" action="#" method="post">
      <fieldset class="am-form-set">
        <input type="text" id="text" name="text" placeholder="text">
        <input type="text" id="reg" name="reg" placeholder="reg">
      </fieldset>
      <div><button type="submit" class="am-btn am-btn-primary am-btn-block">match!</button></div>
    </form>
  </div>
</div>

The above introduces the online regular expression matching test, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn