Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Let's break this regex down.</p> <pre><code>/ </code></pre> <p>Begin regex.</p> <pre><code>.* </code></pre> <p>Match zero or more anything - basically, we're willing to match this regex at any point into the string.</p> <pre><code>(?:\?p= |\?q= |&amp;q= |\?s=) </code></pre> <p>In this, the <code>?:</code> means 'do not capture anything inside of this group'. See <a href="http://www.regular-expressions.info/refadv.html" rel="noreferrer">http://www.regular-expressions.info/refadv.html</a></p> <p>The <code>\?</code> means take <code>?</code> literally, which is normally a character meaning 'match 0 or 1 copies of the previous token' but we want to match an actual ?.</p> <p>Other than that, it's just looking for a multitude of different options to select (<code>|</code> means 'the regex is valid if I match either what's before me or after me.)</p> <pre><code>([a-zA-Z0-9 +]*) </code></pre> <p>Now we match zero or more of any of the following characters in any arrangement: <code>a-ZA-Z0-9 +</code> And since it is inside a <code>()</code> with no <code>?:</code> we DO capture it.</p> <pre><code>(?:&amp;toggle= |&amp;ie=utf-8 |&amp;FORM= |&amp;aq= |&amp;x= |&amp;gwp) </code></pre> <p>We see another <code>?:</code> so this is another non-capturing group. Other than that, it is just full of literal characters separated by <code>|</code>s, so it is not doing any fancy logic.</p> <pre><code>/ </code></pre> <p>End regex.</p> <p>In summary, this regex looks through the string for any instance of the first non capturing group, captures everything inside of it, then looks for any instance of the second non capturing group to 'cap' it off and returns everything that was between those two non capturing groups. (Think of it as a 'sandwich', we look for the header and footer and capture everything in between that we're interested in)</p> <p>After the regex runs, we do this:</p> <p>return matches ? matches[1].split('+') : [];</p> <p>Which grabs the captured group and splits it on <code>+</code> into an array of strings.</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.
 

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