Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Well, for this example at least, if you want to match only the text inside the quotes you'll need to use a capturing group. Write it like this:</p> <pre><code>$pattern = '/"(.*)"/'; </code></pre> <p>and then <code>$matches</code> will be an array of length 2 that contains the text between the quotes in element 1. (It'll still contain the full text matched in element 0) In general, you can have more than one set of these parentheses; they're numbered from the left starting at 1, and there will be a corresponding element in <code>$matches</code> for the text that each group matched. Example:</p> <pre><code>$pattern = '/"([a-z]+) ([a-z]+) (.*)"/'; </code></pre> <p>will select all quoted strings which have two lowercase words separated by a single space, followed by anything. Then <code>$matches[1]</code> will be the first word, <code>$matches[2]</code> the second word, and <code>$matches[3]</code> the "anything".</p> <p>For finding multiple phrases, you'll need to pick out one at a time with <code>preg_match()</code>. There's an optional "offset" parameter you can pass, which indicates where in the string it should start searching, and to find multiple matches you should give the position right after the previous match as the offset. See the <a href="http://us3.php.net/manual/en/function.preg-match.php" rel="nofollow noreferrer">documentation</a> for details.</p> <p>You could also try searching Google for "regular expression tutorial" or something like that, there are plenty of good ones out there.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload