I am trying to write regular expression for the below string  "+1(332)313-1231"   this is my regular expression  var regex=new RegExp('^+1([1-9]{3})+[1-9]{3}+-[1-9]{4}')   how can I correct the regular expression inorder to test the string with above format?
I'm trying to put together a comprehensive regex to validate phone numbers. Ideally it would handle international formats, but it must handle US formats, including the following:   1-234-567-8901 1-234-567-8901 x1234 1-234-567-8901 ext1234 1 (234) 567-8901 1.234.567.8901 1/234/567/8901 12345678901   I'll answer with my current attempt, but I'm hoping somebody has something better and/or more elegant.
In a complete metric space with no isolated points, any countable intersection of open dense sets is uncountable? How to install Anaconda on Ubuntu? "Series" – a noun of multitude similar to "lot", "majority", "percentage", "proportion"– verb agreement According to Garner's fourth edition  Though serving as a plural when the need arises, series is ordinarily a singular noun. But it is also a noun of multitude, so that phrases such as a series of things take a plural verb. However, the collocation there {has been - is} a series has predominated in print sources. Common nouns of multitude: lot, majority, mass, minority, multitude, percentage, proportion, variety.  However,  reads  When it has the singular sense of &quot;one set,&quot; it takes a singular verb, even when series is followed by of and a plural noun: A series of lectures is scheduled.  Are these dissimilar usages stylic advice? Secondly, the inversion after there also chooses singular elsewhere; why is it so?  When the verb precedes the noun percentage, a singular verb is required. That is, a higher percentage of them are, but there is a higher percentage of them. What item bonuses apply to my follower? There are a lot of different side effects an item can have, and I assume that things like magic find have no influence on any of "our" found items at all.  However, I'm not sure about other things. For example:   Do followers get life-steal on weapons, too? Does increased orb healing make any difference? What about +experience after kills? Will my follower level up faster?   and probably a lot more.  Is there some general rule as to what effects of an item apply to followers, and which don't? Help with multirow table I am trying to wrap text in the multirow column (1st one) and only have the vertical lines inside the table if that makes sense.   Can anyone help me? `  \begin{table*}[!htbp] \centering \renewcommand{\arraystretch}{1.4} \begin{tabular}{|c| p{2cm}|c|c|c|c|} \cline{3-6} &amp;&amp;\multicolumn{2}{c|}{\textbf{Gravité du Dommage G1}} &amp; \multicolumn{2}{c|}{\textbf{Gravité du Dommage G2}}\\  \cline{3-6} &amp;&amp;\textbf{Fréquence F1} &amp; \textbf{Fréquence F2} &amp; \textbf{Fréquence F1} &amp; \textbf{Fréquence F2}\\ \hline \multirow{ 2}{*}{\textbf{Probabilité Occurence O1}}&amp;\textbf{Possibilité Evitement P1}&amp;&amp;&amp;&amp;\\ \cline{2-6} &amp;\textbf{Possibilité Evitement P2}&amp;&amp;&amp;&amp;\\ \hline \multirow{ 2}{*}{\textbf{Probabilité Occurence O2}}&amp;\textbf{Possibilité Evitement P1}&amp;&amp;&amp;&amp;\\ \cline{2-6} &amp;\textbf{Possibilité Evitement P2}&amp;&amp;&amp;&amp;\\ \hline \multirow{ 2}{*}{\textbf{Probabilité Occurence O3}}&amp;\textbf{Possibilité Evitement P1}&amp;&amp;&amp;&amp;\\ \cline{2-6} &amp;\textbf{Possibilité Evitement P2}&amp;&amp;&amp;&amp;\\ \hline \end{tabular} \end{table*} Using \ttfamily with \bfseries (or how to enable bold in fixed-width font) I'm using listings package, and I've added basicstyle=\ttfamily\footnotesize. However, when I do that, the keywords from the embedded source-code are not bold anymore.  I figured that \ttfamily together with \bfseries does not work.  And then I found a , and I tried adding \usepackage[bold-extras], and it didn't work either. What does that package do? Should I just ignore it and move on?  And then I finally found , which may be a duplicate to this one, but was a lot harder to find. I also found , which got me more confused.  So, what should I do in order to get a bold fixed-width font for use within listings?  Using pdflatex from texlive-2010. Word for the situation of being unable to pass opposing pedestrian, as you both start to step same direction Is there a word or expression in English, which describes the situation, when you can't pass a  stranger, who is walking towards you on the street, because you both start to step the same direction?  I'm pretty sure I've heard one once. As I remember, it was including "dancing" reference, but in more specific way. What's the deal with a leading underscore in PHP class methods? While looking over various PHP libraries I've noticed that a lot of people choose to prefix some class methods with a single underscore, such as  public function _foo()   ...instead of...  public function foo()   I realize that ultimately this comes down to personal preference, but I was wondering if anyone had some insight into where this habit comes from.  My thought is that it's probably being carried over from PHP 4, before class methods could be marked as protected or private, as a way of implying "do not call this method from outside the class".  However, it also occurred to me that maybe it originates somewhere (a language) I'm not familiar with or that there may be good reasoning behind it that I would benefit from knowing.  Any thoughts, insights and/or opinions would be appreciated. Standard example where Jacobson radical not equal nilradical For which $n$ does $\frac{1}{a}+\frac{1}{b}+\frac{1}{c}=\frac{1}{a+b+c}$ imply $\frac{1}{a^n}+\frac{1}{b^n}+\frac{1}{c^n}=\frac{1}{a^n+b^n+c^n}$ I'm having trouble finishing a problem on an old national competition.  As the title states, the question says asks:  Given $a,b,c \neq 0,a+b=c$ such that $\frac{1}{a}+\frac{1}{b}+\frac{1}{c}=\frac{1}{a+b+c}$,  Find all integers $n$ such that $\frac{1}{a^n}+\frac{1}{b^n}+\frac{1}{c^n}=\frac{1}{a^n+b^n+c^n}$.  I know that if it is true for $n$, it is also true for $-n$ since $(a^n+b^n+c^n)(\frac{1}{a^n+b^n+c^n})=1$ and $(a^n+b^n+c^n)(\frac{1}{a^n}+\frac{1}{b^n}+\frac{1}{c^n})=1$ and the statment follows for $-n$ given that we can make the substitution for $n$. Thus I found out that $n=-1$ satisfies the equality.  I also know that it fails for all even $n$. If $n$ were even, $(a^n,b^n,c^n)$ would all be positive, and Titu's Lemma asserts that $\frac{1}{a^n}+\frac{1}{b^n}+\frac{1}{c^n}\geq \frac{9}{a^n+b^n+c^n}$. Thus $n$ must be odd.  I also observed that $(2,-1,1)$ was a solution, and from here noted that this particular solution satisfies all odd $n$.  I have been trying to prove that all other solutions satisfy all odd $n$ with no success.  Any help would be greatly appreciated. Thanks! On June 13th 2017 all SharePoint calculated columns with HTML markup stopped working.   Basically the fields now render text (regardless of setting the data type to number). The gist of the notice from Microsoft () is:     In Microsoft SharePoint lists and libraries, calculated fields that   are running in the classic UI mode can be used to display results   based on Excel-like formulas. This is a long standing capability, and   is documented in Calculate data in lists or libraries.      Some users have added HTML markup or script elements to calculated   fields. This is an undocumented use of the feature, and we will begin   blocking execution of custom markup in calculated fields in SharePoint   Online from June 13, 2017 onwards. We are also providing this as a   configurable option for on-premises in SharePoint Server 2016 and   SharePoint Server 2013 via the June 2017 and subsequent Public   Updates.   As we don't have on premise SharePoint (online), we have to find an immediate work around, given that this impacts our processes and thus, business.   Is anyone aware of third party applications that will allow for HTML, script markup (that works with SP online)? I used python add in to make a tool bar in Arcmap that edits features on a map. It works on a file geodatabase, but not on an ArcSDE version one. I've been getting an FDO error: 0. The solutions that I've found all involve opening a workspace, but I'm getting an error doing that as well. Here is the relevant portion of my code:          outFolderPath = r"U:\tempStuff"         outName = "Stuff.sde"         databasePlatform = "SQL_Server"         instance = "SQL Server"         arcpy.CreateDatabaseConnection_management(outFolderPath, outName,                                                   databasePlatform,                                                   instance)         print "Centroid of buidling:(%r,%r) Side length: %r" % (xCoordinate,                                                                 yCoordinate,                                                                 bob)         print "workspace is %r" % outName #outName is workspace          #Start edit session with an undo/redo stack then start         #edit operation         print "Starting editing"         edit = arcpy.da.Editor(outName) #outName is workspace Line 86         edit.startEditing(True, True)         edit.startOperation()          #stuff happens          cursor = arcpy.da.InsertCursor( fc, ["SHAPE@"])         cursor.insertRow([stuff])             #stop the edit operation and then save changes         edit.stopOperation()         edit.stopEditing(True)          del cursor         print "Building should be drawn"   This is the exact error I've been getting:  Traceback (most recent call last):   File "C:\Users\153289\AppData\Local\ESRI\Desktop10.3\AssemblyCache\{0BEF4E61-6332-4BCA-A908-959CA3C0B4E7}\leetScripts_addin.py", line 86, in onClick     edit = arcpy.da.Editor(outName)#outName is workspace RuntimeError: cannot open workspace   What's am I doing wrong in my code? I am trying to run some unit tests in a C# Windows Forms application (Visual Studio 2005), and I get the following error:  System.IO.FileLoadException: Could not load file or assembly 'Utility, Version=1.2.0.200, Culture=neutral, PublicKeyToken=764d581291d764f7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)** at x.Foo.FooGO() at x.Foo.Foo2(String groupName_) in Foo.cs:line 123 at x.Foo.UnitTests.FooTests.TestFoo() in FooTests.cs:line 98** System.IO.FileLoadException: Could not load file or assembly 'Utility, Version=1.2.0.203, Culture=neutral, PublicKeyToken=764d581291d764f7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)  I look in my references, and I only have a reference to Utility version 1.2.0.203 (the other one is old). Any suggestions on how I figure out what is trying to reference this old version of this DLL file? Besides, I don't think I even have this old assembly on my hard drive. Is there any tool to search for this old versioned assembly? Where $\phi(n)$ is the Euler phi function, how do you find all $n$ such that $\phi(n)|n$? When I log in with LightDM on my laptop running Debian Unstable, it recently started to hang for around 2 minutes until journalctl shows the message kernel: random: crng init done. When I press random keys on my keyboard while it hangs, it logs in faster (around 10 seconds). Before I didn't have this issue, is there any way I can fix it?  Edit: using linux-image-4.15.0-3-amd64 instead of linux-image-4.16.0-1-amd64 works, but I don't want to use an older kernel. Cheaper zoom lenses usually are faster at the wide end and slower at the long end (for example, the $150 Canon EF-S 18-55mm f/3.5-5.6). More expensive constant-aperture zoom lenses have the same aperture regardless (for example, $800 Canon EF 17-40mm f/4.0 L).  My question is: are these good lenses  at the wider settings, or do they have a different optic system that allows them to maintain the same aperture throughout the zoom range? Where is the preferred place to set the PATH envvar?  ~/.profile or /etc/environment?  What is the case when PATH is set in both places? Is the end result a concatenation of both values set in those two places? There is a part of my paper where I use the distributive property and it might not be clear to the reader to see the operation result (I'm using in proposional logic for a proof). The logic equation (part of) is: $$ (l_{1}) \vee \big( (p \vee q) \wedge (\neg p \vee q) \wedge (p \vee \neg q) \wedge (\neg p \vee \neg q)\big) $$ $$ (l_{1} \vee p \vee q) \wedge (l_{1} \vee \neg p \vee q) \wedge (l_{1} \vee p \vee \neg q) \wedge (l_{1} \vee \neg p \vee \neg q) $$  So I was wondering if there is a way to represent this operation like a 'shower' (see another example in pic ). Maybe there is some hidden magic mathmode command or pkg for this. At last we can also rely on tikz. Enumerate in multicols how to move the last element upwards Code: \documentclass{article} \usepackage[a5paper]{geometry} \usepackage{multicol} \setlength{\parindent}{0cm} \begin{document} \begin{multicols}{2}   \begin{enumerate}   \item text 1   \item text 2   \item text 3   \item text 4   \item text 5   \end{enumerate} \end{multicols} \end{document}  Gives this:  How to move &quot;text 5&quot; upwards adjacent to &quot;text 4&quot;? How to make a drive NTFS from EXT4? I want to know how to make a drive ( non-system ) from EXT4 to NTFS. Can anyone help me out?