Difference between revisions of "Erasesentencefromend"

From Theonomy Wiki
 
(33 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#switch:{{{2|1}}}
+
<noinclude>[[:Thread:Talk:Erasesentencefromend/How_to_use|How to use this template]]</noinclude>{{#vardefine:notdelim|[^\.\。\.\;\?\!]}}{{#vardefine:sentdelim|[\.\.\。\;\?\!]}}{{#switch:{{{2|4}}}
|1={{#rmatch:{{{1|}}}|/^(.*?) # capture everything up to the last sentence
+
|1={{#rmatch:{{{1|}}}|/^(.*?) {{#var:notdelim}}+ {{#var:sentdelim}}* ({{#var:notdelim}}+?) $ /sx|$1{{{3|}}}$2|}}
[^\.\;\?\!]+ # Everything up to the sentence delimiter
+
|2={{#rmatch:{{{1|{{#scripture:Deuteronomy 14:20-21|scriptrefstyle=show}}}}}|/^(.*?) {{#var:notdelim}}+ {{#var:sentdelim}}+ {{#var:notdelim}}+ {{#var:sentdelim}}* ({{#var:notdelim}}+?) $ /sx|$1{{{3|}}}$2|}}
[\.\;\?\!]* # Any number of sentence delimiters
+
|3={{#rmatch:{{{1|}}}|/^(.*?) {{#var:notdelim}}+ {{#var:sentdelim}}+ {{#var:notdelim}}+ {{#var:sentdelim}}+ {{#var:notdelim}}+ {{#var:sentdelim}}* ({{#var:notdelim}}+?) $ /sx|$1{{{3|}}}$2|}}
([^\.\;\?\!]*?) # Anything after the sentence at the end (like HTML markup)
+
|4={{#rmatch:{{{1|}}}|/^(.*?) {{#var:notdelim}}+ {{#var:sentdelim}}+ {{#var:notdelim}}+ {{#var:sentdelim}}+ {{#var:notdelim}}+ {{#var:sentdelim}}+ {{#var:notdelim}}+ {{#var:sentdelim}}* ({{#var:notdelim}}+?) $ /sx|$1|}}
$ # anchors at the end of the input
+
|5={{#rmatch:{{{1|}}}|/^(.*?) {{#var:notdelim}}+ {{#var:sentdelim}}+ {{#var:notdelim}}+ {{#var:sentdelim}}+ {{#var:notdelim}}+ {{#var:sentdelim}}+ {{#var:notdelim}}+ {{#var:sentdelim}}+ {{#var:notdelim}}+ {{#var:sentdelim}}* ({{#var:notdelim}}+?) $ /sx|$1|}}}}
/sx|$1$2}}
 
|2={{#rmatch:{{{1|}}}|/^(.*?)[^\.\;\?\!]+[\.\;\?\!]+[^\.\;\?\!]+[\.\;\?\!]*[^\.\;\?\!]*?$/s|$1|}}
 
|3={{#rmatch:{{{1|}}}|/^(.*?)[^\.\;\?\!]+[\.\;\?\!]+[^\.\;\?\!]+[\.\;\?\!]+[^\.\;\?\!]+[\.\;\?\!]*[^\.\;\?\!]*?$/s|$1|}}
 
|4={{#rmatch:{{{1|}}}|/^(.*?)[^\.\;\?\!]+[\.\;\?\!]+[^\.\;\?\!]+[\.\;\?\!]+[^\.\;\?\!]+[\.\;\?\!]+[^\.\;\?\!]+[\.\;\?\!]*[^\.\;\?\!]*?$/s|$1|}}
 
|5={{#rmatch:{{{1|}}}|//^(.*?)[^\.\;\?\!]+[\.\;\?\!]+[^\.\;\?\!]+[\.\;\?\!]+[^\.\;\?\!]+[\.\;\?\!]+[^\.\;\?\!]+[\.\;\?\!]+[^\.\;\?\!]+[\.\;\?\!]*[^\.\;\?\!]*?$/s|$1|}}
 
}}
 

Latest revision as of 21:50, 3 September 2020