Difference between revisions of "Erasesentencefromend"

From Theonomy Wiki
m (Protected "Erasesentencefromend" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
Line 1: Line 1:
 
{{#switch:{{{2|1}}}
 
{{#switch:{{{2|1}}}
|1={{#rmatch:{{{1|}}}|/^(.*?)[^\.\;\?\!]+[\.\;\?\!]*[^\.\;\?\!]*?$/s|$1}}
+
|1={{#rmatch:{{{1|}}}|/^(.*?) # capture everything up to the last sentence
 +
[^\.\;\?\!]+ # Everything up to the sentence delimiter
 +
[\.\;\?\!]* # Any number of sentence delimiters
 +
[^\.\;\?\!]*? # Anything after the sentence at the end (like HTML markup)
 +
$ # anchors at the end of the input
 +
/sx|$1$2}}
 
|2={{#rmatch:{{{1|}}}|/^(.*?)[^\.\;\?\!]+[\.\;\?\!]+[^\.\;\?\!]+[\.\;\?\!]*[^\.\;\?\!]*?$/s|$1|}}
 
|2={{#rmatch:{{{1|}}}|/^(.*?)[^\.\;\?\!]+[\.\;\?\!]+[^\.\;\?\!]+[\.\;\?\!]*[^\.\;\?\!]*?$/s|$1|}}
 
|3={{#rmatch:{{{1|}}}|/^(.*?)[^\.\;\?\!]+[\.\;\?\!]+[^\.\;\?\!]+[\.\;\?\!]+[^\.\;\?\!]+[\.\;\?\!]*[^\.\;\?\!]*?$/s|$1|}}
 
|3={{#rmatch:{{{1|}}}|/^(.*?)[^\.\;\?\!]+[\.\;\?\!]+[^\.\;\?\!]+[\.\;\?\!]+[^\.\;\?\!]+[\.\;\?\!]*[^\.\;\?\!]*?$/s|$1|}}

Revision as of 16:33, 22 July 2020