Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The problem is that .* does not include new line. regex in such predefined labels that appear once in text (expecting single match) might not be the best way to go, why not just find IndexOf and use substring. </p> <p>If you still want to use regex add \r\n meaning [.\r\n]* using \s\S will give you pretty much the same as </p> <p>\s is Equivalent to [ \f\n\r\t\v].</p> <p>\S is Equivalent to [^ \f\n\r\t\v].</p> <p>another option would be to set regex matches to Single-line Mode. (name is confusing but it acctually means it allows dot "." to grab new lines)</p> <p>below is a substring usage example.</p> <pre><code>String startTag = "[AddonsListSTART]"; String endTag = "[AddonsListEND]" int start = htmlEmail.IndexOf(startTag ); int end = htmlEmail.IndexOf(endTag); String res =""; if((start&gt;=0) &amp;&amp; (end&gt;=0)){ res = htmlEmail.substring(start + startTag.length,end - (start + startTag.length)); } </code></pre> <p>here is a single line mode usage : (note RegexOptions.Singleline )</p> <pre><code>//Find Add-ons HTML : between [AddonsListSTART] &amp; [AddonsListEND] Regex rgxAddonSE = new Regex(@"\[AddonsListSTART\](?&lt;MyHtml&gt;.*)\[AddonsListEND\]", RegexOptions.Singleline); Match matchAddonSE = rgxAddonSE.Match(htmlEmail); string htmlAddons = matchAddonSE.ToString(); </code></pre> <p>same thing except using the single line mode from within pattern</p> <pre><code>Regex rgxAddonSE = new Regex(@"(?s)\[AddonsListSTART\](?&lt;MyHtml&gt;.*)\[AddonsListEND\]"); </code></pre>
    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. 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