Note that there are some explanatory texts on larger screens.

plurals
  1. POSplit a string by comma, quote and full-stop.. with a few exceptions
    primarykey
    data
    text
    <p>I've got a lot of text, similar to the following paragraph, which I'd like to split into words without punctuation (<code>'</code>, <code>"</code>, <code>,</code>, <code>.</code>, <code>newline</code> etc).. with a few exceptions.</p> <blockquote> <p>Initially considered endemic to the Chalakudy River system in Kerala state, southern India, but now recognised to have a wider distribution in surrounding drainages including the Periyar, Manimala, and Pamba river though the Manimala data may be questionable given it seems to be the type locality of P. denisonii.</p> <p>In the Achankovil River basin it occurs sympatrically, and sometimes syntopically, with P. denisonii.</p> <p>Wild stocks may have dwindled by as much as 50% in the last 15 years or so with collection for the aquarium trade largely held responsible although habitats are also being degraded by pollution from agricultural and domestic sources, plus destructive fishing methods involving explosives or organic toxins.</p> </blockquote> <p>The text refers to <code>P. denisonii</code> which is a species of fish. It's an abbreviation of <code>Genus species</code>. I would like this reference to be one word.</p> <p>So, for instance, this is the kind of array I'd like to see:</p> <pre><code>Array ( ... [44] given [45] it [46] seems [47] to [48] be [49] the [50] type [51] locality [52] of [53] P. denisonii [54] In [55] the ... ) </code></pre> <p>The only things that distinguish these species references such as <code>P. denisonii</code> from a new sentence like <code>end. New</code> are:</p> <ul> <li><strong>The P</strong> (for Puntius, as in the P. in the aforementioned example) <strong>is only ever one letter, always a capital</strong></li> <li><strong>the d</strong> (as in . denisonii) <strong>is always either a lower case letter or an apostrophe (<code>'</code>)</strong></li> </ul> <p>What regexp can I use with <code>preg_split</code> to give me such an array? I've tried a simple <code>explode( " ", $array )</code> but it doesn't do the job at all.</p> <p>Thanks in advance,</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.
 

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