Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's a reasonably good regex for matching the first twenty visible words:</p> <pre><code>'~^(?:\s*+(?:(?:[^&lt;&gt;\s]++|&lt;/?\w[^&lt;&gt;]*+&gt;)++)){1,20}~' </code></pre> <p>This matches one to twenty whitespace-separated tokens, where a token is defined as one or more words or tags not separated by whitespace (where a "word" is defined as one or more characters other than whitespace or angle brackets). For example, this would be one token:</p> <pre><code>&lt;a href="http://www.amazing.com/"&gt;Amazing&lt;/a&gt; </code></pre> <p>...but this is two tokens:</p> <pre><code>&lt;a href="http://www.superduper.com/"&gt;Super Duper&lt;/a&gt; </code></pre> <p>This will treat a standalone tag (like the <code>&lt;img&gt;</code> tag in your example, or any tag that's surrounded by whitespace) as a separate token, which throws off the count--it only matches up to the word "of" in your example. It also won't correctly handle <code>&lt;br&gt;</code> tags, or block-level tags like <code>&lt;p&gt;</code> and <code>&lt;table&gt;</code>, if they <em>don't</em> have any whitespace around them. Only you can know how much of a problem that will be.</p> <p>EDIT: If that isolated <code>&lt;img&gt;</code> tag is something you see a lot, you could preprocess the text to remove the whitespace following it. That would effectively merge it with the first subsequent "real" token, resulting in a more accurate character count. I know it only changes the count by one or two characters in this case, but if the twentieth word happened to "supercalifragilisticexpialidocious" you'd probably notice the difference. :)</p>
    singulars
    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.
 

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