Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I don't know C# regex or what you are trying to do (ie: edit, validate,.. etc)<br> I know Perl, so I'll take a stab at it.<br> In regex's a period is a meta character. If you want a literal period, you have to escape<br> it with a '.' The meta period says match any character. If you want a literal period,<br> and to keep what you have, in Perl you either should not double quote the regex or escape<br> the escape. A single quote should work fine.<br> <code>'((www)\.([a-zA-Z0-9]{1,6}+\.+)*[a-zA-Z]{2,6})'</code> </p> <p>Now, unless you want multiple literal periods, you should get rid of the + quantifier<br> <code>'((www)\.([a-zA-Z0-9]{1,6}+\.)*[a-zA-Z]{2,6})'</code> </p> <p>As was said, {n,m} itself is a quantifier. Adding + after it is a double quantifier.<br> In Perl adding + after a quantifyer implies a possesive condition and is legal starting in version 5.10<br> So, getting rid of the extra + it is now<br> <code>'((www)\.([a-zA-Z0-9]{1,6}\.)*[a-zA-Z]{2,6})'</code> </p> <p>Finally, the * quantifyer implies 0 or more times. Why would you want to match 0 times?<br> Fixing that it is now<br> <code>'((www)\.([a-zA-Z0-9]{1,6}\.)+[a-zA-Z]{2,6})'</code></p> <p>As an extra, you have a main grouping around everything, a grouping around www, and one<br> around the middle ([a-zA-Z0-9]{1,6}.)+ which does no good in capture, just in grouping.<br> If you want to capture the beginning, middle, end, you should add appropriate capture<br> <code>'((www\.)(([a-zA-Z0-9]{1,6}\.)+)([a-zA-Z]{2,6}))'</code> </p> <p>Or, in Perl, that would be better written as<br> <code>'((www\.)((?:[a-zA-Z0-9]{1,6}\.)+)([a-zA-Z]{2,6}))'</code> </p>
 

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