I want an regex for email that starts with numbers and letters.  My regex is   /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/   What is wrong in this? It allows ._- from start and in between. But I don't want this  Valid emails = s@gmail.com, s.p@y.com, s_p123@g.com   Invalid emails = ....s@g.com, s---g@g.com, s...@g.com, 44s..p@g.com, ----s@g.com  Does anyone know how this can be done?
Over the years I have slowly developed a  that validates MOST email addresses correctly, assuming they don't use an IP address as the server part.  I use it in several PHP programs, and it works most of the time.  However, from time to time I get contacted by someone that is having trouble with a site that uses it, and I end up having to make some adjustment (most recently I realized that I wasn't allowing 4-character TLDs).  What is the best regular expression you have or have seen for validating emails?  I've seen several solutions that use functions that use several shorter expressions, but I'd rather have one long complex expression in a simple function instead of several short expression in a more complex function.
I know people love to close duplicates so I am not asking for a reference to start learning statistics (as ).   I have a doctorate in mathematics but never learned statistics. What is the shortest route to the equivalent knowledge to a top notch BS statistics degree and how do I measure when I have achieved that.   If a list of books would suffice (assuming I do the exercises lets say), that's terrific. Yes, I expect working out problems to be an implicit part of learning it but I want to fast track as much as realistically possible. I am not looking for an insanely rigorous treatment unless that is part of what statistical majors generally learn. How do I install Ubuntu alongside a pre-installed Windows with UEFI? Why do I have different IP addresses on different websites? My wireless router shows the IP address is 113.46.75.*, which some websites like ip138.com, www.ip.cn show as my IP.   But other websites, like googling for "what is my ip", www.whatismyip.com, www.whatsmyip.org, show that my IP is 121.18.126.*.   I am very curious why this happens and how is it possible.   So, why do different websites show that I have different IPs?  Thanks all!  Plus: I changed my IP address several times (restarting the modem) and all addresses is like 113.46.*.*, but my IP address does not change when googling for "what is my ip".  My ISP is a small company, so I think it is true that when visiting some websites, I am NATted or proxied to some IP addresses which have access to those websites -- not to avoid firewall though, since I am still blocked from some websites.  But I still want some more information or resources to support our guess. Thank you! How to derive variance-covariance matrix of coefficients in linear regression Arrows linking table cells I'm currently trying to add arrows in my synthetic division example to show people clearly how synthetic division works. I'm working on Overleaf.   The code for my synthetic division right now is:  \begin{tabular}{c |r r r r r}     &amp;1&amp; 4 &amp; -1&amp;16&amp;-20\\   1&amp;&amp; 1 &amp; 5 &amp; 4&amp;20\\   \hline    &amp;1 &amp;5 &amp; 4 &amp; 20 &amp;\rule{3pt}{16pt}\;0\\   \end{tabular}   How would I add arrows to this? For instance, a down arrow going from the first 1 to 1, then an upwards arrow pointing right from 1 to 1, then an arrow pointing down from 1 to 5, etc. Basically I would like to add arrows that look like this: Show that $\sum_{i=1}^n (x_i - \bar{x})(y_i - \bar{y}) = \sum_{i=1}^n (x_i - \bar{x})(y_i)$. Show that $\sum_{i=1}^n (x_i - \bar{x})(y_i - \bar{y}) = \sum_{i=1}^{n} (x_i - \bar{x})(y_i)$. I fell into this hole where I keep finding that $$\sum_{i=1}^n (x_i - \bar{x}) = \sum_{i=1}^n x_i - \sum_{i=1}^n \bar{x} = n\bar{x} - n\bar{x} = 0$$ This seems true, but I know that I am missing something, since this implies that covariance is always zero, which is obviously not true. How can I block incoming SMS from certain senders? How do you get the footer to stay at the bottom of a Web page? "What kind of a person" vs. "what kind of person" The cow in the field problem (intersecting circular areas) What length of rope should be used to tie a cow to an exterior fence post of a circular field so that the cow can only graze half of the grass within that field?  updated: To be clear: the cow should be tied to a post on the exterior of the field, not a post at the center of the field. $m$ is the Lebesgue measure. I was thinking that: $\Bbb Q$ is dense and $m(\Bbb Q)=0&lt;1$ but it fails to be open, but maybe I could construct an open set from this fact, or also using that $(0,1)$ is a dense and open subset but $m(0,1)=1$.   Any hints or ideas will be very appreciated. Thanks. Proving normality of affine schemes One of the exercises in Ravi Vakil's algebraic geometry notes, Ex. $5.4.$I(b), is to show that    $$ \operatorname{Spec}\left(k[x_1, \ldots, x_n]/(x_1^2 + \cdots + x_m^2)\right) $$   is normal, where $k$ is any field of $\operatorname{char}(k)\neq 2$, and $n \geq m \geq 3$.    I have absolutely no idea how to get started on this. Is there anyone that could give a hint as to how one would approach this problem? Can I combine extension tubes and macro filters at once to give better macros? Why the default eth0 interface is down by default on CentOS? Full file date (without GNU utilities) I am trying to obtain the full date (created or modified) of a particular file for passing to another program. I have tried variations of options with the ls command but none provide a full date for files less than 6 months old and I have limit usage of the options. When I try certain options I have seen trying to research this I get the following message:  usage: ls [-1ACFHLNRabcdefgilmnopqrstuxEUX] [File...]   None of which seems to provide what I needs as far as I can tell so I tried to use the stat command but it is not available to me.  I am using the Korn shell on AIX 5.3 which has limited commands available, can anyone suggest another way that I might be able to obtain a file's created or modified date as a full date (either dd/mm/yyyy or yyyy/mm/dd). Which function ($f$) is continuous nowhere but $|f(x)|$ is continuous everywhere? Which function ($f$) is continuous nowhere but $|f(x)|$ is continuous everywhere?   I found this question , the question seems much interesting but for obvious reason it is closed there, I was wondering how to derive such a function? I just installed Ubuntu 14.04.3 LTS after installing windows 10 in my new VN7-571G and the wireless is not working. It never had: even during the installation it was not recognized. I run a script to gather the data , which is . lspci -knn | grep Net -A2 output 03:00.0 Network controller [0280]: Qualcomm Atheros Device [168c:003e] (rev 20)         Subsystem: Lite-On Communications Inc Device [11ad:0804]  The OS behaves like it has no wifi card. I do not see wifi settings in network settings I'm not a linux power user, so I do not know what to do to solve the issue. What should I do to make it work? Mount cifs Network Drive: write permissions and chown I have access to a cifs network drive. When I mount it under my OSX machine, I can read and write from and to it.   When I mount the drive in ubuntu, using:  sudo mount -t cifs -o username=${USER},password=${PASSWORD} //server-address/folder /mount/path/on/ubuntu   I am not able to write to the network drive, but I can read from it. I have checked the permissions and owner of the mount folder, they look like:  4.0K drwxr-xr-x  4 root root    0 Nov 12  2010 Mounted_folder   I cannot change the owner, because I get the error:  chown: changing ownership of `/Volumes/Mounted_folder': Not a directory   When I descend deeper into the network drive, and change the ownership there, I get the error that I have no permission to change the folder´s owner.  What should I do to activate my write permission? How to detect if a function is called as constructor? Given a function:  function x(arg) { return 30; }   You can call it two ways:  result = x(4); result = new x(4);   The first returns 30, the second returns an object.  How can you detect which way the function was called inside the function itself?  Whatever your solution is, it must work with the following invocation as well:  var Z = new x();  Z.lolol = x;  Z.lolol();   All the solutions currently think the Z.lolol() is calling it as a constructor. A problem about function N