Note that there are some explanatory texts on larger screens.

plurals
  1. PO.NET regular expression to match "anything else"
    primarykey
    data
    text
    <p>I am constructing a <a href="http://en.wikipedia.org/wiki/Regular_expression" rel="nofollow noreferrer">regular expression</a> that will contain a number of groups in a logical OR relationship ...</p> <pre><code>(group A)|(group B)|(group C) </code></pre> <p>This expression already successfully matches its intended sub-strings, but I need to add a final group that will match anything else, with the result that the target string will be entirely consumed by matches.</p> <p>Can anyone please suggest what this missing group expression should be?</p> <p>Edit: Linefeeds are not an issue, so I assume we can use the simpler of the proposed syntaxes. However, I am clearly doing something really dumb, as I have simplified my expression such that it only contains (.*?) and it refuses to capture anything - just a bunch of empty matches. (I am using Rad Regex Designer for testing, but I have also tried another Regex tool and the result is the same).</p> <p>Edit: As suggested, here is an example input. This is a simple Excel formula, but it could be any Excel formula:</p> <pre><code>SUM(A5:D9)+AVERAGE(F5:I5)-LOOKUP(L5, N5:N14) </code></pre> <p>The group expressions described above are designed to extract cell references (e.g. L5) or cell range references (e.g. F5:I5). So, when the expression is executed against the sample input, it must produce the following 9 captures:</p> <ol> <li><code>SUM(</code> </li> <li><code>A5:D9</code></li> <li><code>)+AVERAGE(</code></li> <li><code>F5:I5</code></li> <li><code>)-LOOKUP(</code></li> <li><code>L5</code></li> <li><code>,</code></li> <li><code>N5:N14</code></li> <li><code>)</code></li> </ol>
    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.
    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