Ejemplo n.º 1
0
 public function test_escapeChars__Case_wildchar_inside()
 {
     $roman = 'inuit';
     $syll = Syllabics::latinAlphabetToUnicode($roman, '0');
     $query_syll = $syll . '\\S*?' . $syll;
     $escaped = Grepper::escapeChars($query_syll);
     $expected = '\\x{e1}\\x{90}\\x{83}\\x{e1}\\x{93}\\x{84}\\x{e1}\\x{90}\\x{83}\\x{e1}\\x{91}\\x{a6}\\S*?\\x{e1}\\x{90}\\x{83}\\x{e1}\\x{93}\\x{84}\\x{e1}\\x{90}\\x{83}\\x{e1}\\x{91}\\x{a6}';
     $this->assertEquals($expected, $escaped, "The escaping has failed.");
 }
Ejemplo n.º 2
0
<?php

require 'webgrep.php';
$grepper = new Grepper();
$searchTerm = $_POST['string'];
$url = $_POST['url'];
$ignoreHtml = (bool) $_POST['ignoreHtml'];
if ($_POST['url']) {
    $grepper->gatherLinks($url);
}
?>

<html>
    <head>
        <title>Grep the world!</title>
        <link rel="stylesheet" href="style.css">
        <script src="http://code.jquery.com/jquery-1.12.0.min.js"></script>
        <script src="jquery.highlight-5.js"></script>
    </head>
<body>
  <main>
    <section>
      <form method="POST">
        <div>
          <h2>URL</h2>
            <input type="url" required name="url" placeholder="www.domain.com">
        </div>

        <div>
          <h2>Search Term</h2>
          <input required name="string" placeholder="Enter the string to search for">