I have this regex   var reg = new RegExp('["\\&gt;]{1}\\$([^"\\&lt;\\&gt; ]*)["\\&lt;]{1}', 'g');   That I run on this string  '&lt;span&gt;$name&lt;/span&gt;&lt;img src="$images[0].src"&gt;&lt;img src="$images[1].src"&gt;&lt;img src="$images[2].src"&gt;'   If I test it on sites like  it works properly but if I test it in FireFox     var reg = new RegExp('["\\&gt;]{1}\\$([^"\\&lt;\\&gt; ]*)["\\&lt;]{1}', 'g'); var match = reg.exec('&lt;span&gt;$name&lt;/span&gt;&lt;img src="$images[0].src"&gt;&lt;img src="$images[1].src"&gt;&lt;img src="$images[2].src"&gt;'); console.log(match);     It only matches "&gt;$name&lt;". How to have it catch all like on the site?  This is not a duplicate. i'm not working with query strings, beside it works online of the site.
I am trying to parse url-encoded strings that are made up of key=value pairs separated by either &amp; or &amp;amp;.   The following will only match the first occurrence, breaking apart the keys and values into separate result elements:  var result = mystring.match(/(?:&amp;|&amp;amp;)?([^=]+)=([^&amp;]+)/)   The results for the string '1111342=Adam%20Franco&amp;348572=Bob%20Jones' would be:  ['1111342', 'Adam%20Franco']   Using the global flag, 'g', will match all occurrences, but only return the fully matched sub-strings, not the separated keys and values:  var result = mystring.match(/(?:&amp;|&amp;amp;)?([^=]+)=([^&amp;]+)/g)   The results for the string '1111342=Adam%20Franco&amp;348572=Bob%20Jones' would be:  ['1111342=Adam%20Franco', '&amp;348572=Bob%20Jones']   While I could split the string on &amp; and break apart each key/value pair individually, is there any way using JavaScript's regular expression support to match multiple occurrences of the pattern /(?:&amp;|&amp;amp;)?([^=]+)=([^&amp;]+)/ similar to PHP's preg_match_all() function?  I'm aiming for some way to get results with the sub-matches separated like:  [['1111342', '348572'], ['Adam%20Franco', 'Bob%20Jones']]   or   [['1111342', 'Adam%20Franco'], ['348572', 'Bob%20Jones']]
Showing that $|N \cap Z(G)| > 1$ for normal subgroups of p-groups Don't worry, I have written your name on the attendance sheet.   Or     Don't worry, I wrote your name on the attendance sheet. Selecting attributes or rows of polygons that intersect two attributes of overlaying polygon using ArcGIS Pro Can we add Markdown support for tables? How do I shuffle cards for a card game? I am trying to develop an card game for Android Can anyone suggest me how to write code for effectively shuffling the playing cards? 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. Find the eigenvector associated with the smallest eigenvalue, not smallest in magnitude Would Beetee's electrocution plan work and kill the tributes in the lake? In , the second episode of the Hunger Games trilogy, one of the characters (Beetee) proposes a plan to kill some of the remaining tributes. He proposes wrapping a special wire that he has designed to withstand the vast energy of lightning around a tall tree and running it down to a salt water lake. Then when lightening strikes the tree (which it does predictably every twelve hours) anyone in the lake will be killed. (N.B. This is not Beetee's real plan, but it is the one he wants his allies to believe.)  I don't think his plan would work at all. Assuming that his wire can carry the enormous current delivered by a lightening strike (this is fiction after all) surely the current would short to ground through the salt water rather than taking a path through anyone standing or swimming in the water. The analogy I have in mind is that of birds standing untroubled on live electricity wires. They are unharmed because they do not provide a path to earth. But another analogy might be dropping a mains electric heater into a bath when you are in it. I think that kills you (though I'm not sure why.) I have Canon lenses and would like to purchase an adapter to use them on the D3200? Is there one available? If so name and model would be appericated. I understand that I will have to shoot on manual mode. Minecraft Survival Mode In a ring $(A,+, \cdot)$ if $aba = a$ then $bab = b$ and all non zero elements in $A$ are invertible. I've been using Windows 10 for a couple of month now (joined the Insider Preview).  Now my hard drive started ticking so I've bought a new SSD and I want to move the windows installation to the new hard drive, which has been connected to the computer (unpartitioned). I don't mind and I even prefer reinstalling it over again.   Since I have the free version of Windows 10 pro, can I still reinstall it anew? Does the windows 10 installation offer disk management and partition like the older Windows installations used to? How should I reinstall Winodws 10 x64 the easiest but still remain on free mode? I am using an external application to enter data into a Google Spreadsheet.  This workbook is then referenced by a separate workbook (with the IMPORTRANGE(spreadsheet_key, range_string) function) that manipulates and interprets the data.  My problem is that whenever I personally modify the referenced workbook, the referencing workbook updates just fine, but whenever the external application modifies it, it does not get updated.  I have tried editing the "Spreadsheet settings" so that recalculation is done every minute and on every change.  Furthermore, I have also installed an extension in Google Chrome that auto-refreshes the page every hour.  However, the data does not get re-imported from the referenced workbook.  Even if I copy the formula into a new cell, the data is still not re-imported.  Is there anything that I can do to the referencing workbook to trigger Google Sheets to re-import the data?  Edit: Just to be clear, I currently have one workbook with data entered by an external application in it (call it the "source sheet"), and another workbook with an IMPORTRANGE function in it (call it the "referencing sheet").  The data shown by the IMPORTRANGE function in the "referencing sheet" does not include any data entered by the external application since I last personally edited the "source sheet".  Also, both workbooks are using the new Google Sheets.  Edit: Also, this question is not the same as  because I am using the function given as the solution to that question to import data from a spreadsheet.  The problem is not how to import the data, but rather how to update the source for the data.  My assumption would be that Google would have taken care of this for me, but the data in the "referencing sheet" does not get updated, and the only way I can find to get it to update is to physically go into the "source sheet" and edit it myself. Out-of-control starship results in some crew members landing in a rebirthed universe? Receiving Push Notifications while in background How can I find duplicate photos? What can I use to find duplicate photos, including photos that have been resized? Url rewriting in Amazon S3 I have a webapp hosted in Amazon S3, the webapp is build with jQuery Mobile and I use changePage lo navigate between pages, I'm not using the hash operator(#) when I change the page.  I'm having problems when the user copy the url and paste it in a new tab  For example:    loads the page page1.html that is in amazon s3 with only the jquery page structure...  The behavior that I want is that load index.html and with js read the url, detect the page and load the correct page.  With Apache I solve this with URL Rewriting... but for Amazon S3 I didn't find any similar...  NOTE: I know that if I activate the hash operator (#) in my urls the problem is solved but I need clean urls without #. Power Series proofs $$\alpha(x) =\sum_{j=0}^\infty \frac{x^{3j}}{(3j)!}$$  $$\beta(x) = \sum_{j=0}^\infty \frac{x^{3j+2}}{(3j+2)!}$$  $$\gamma(x) = \sum_{j=0}^\infty \frac{x^{3j+1}}{(3j+1)!}$$  Show that $\alpha(x+y) = \alpha(x)α(y) + \beta(x)\gamma(y) + \beta(y)\gamma(x)$ for every $x, y \in\mathbb R$.  Show that $\alpha(x)^3 + \beta(x)^3 + \gamma(x)^3 − 3\alpha(x)\beta(x)\gamma(x) = 1$ for every $x\in\mathbb R$.  My work:  Ive noticed that $$\sinh(x)=\sum_{j=0}^\infty \frac{x^{2j+1}}{(2j+1)!}$$ and $$\cosh(x)=\sum_{j=0}^\infty \frac{x^{2j}}{(2j)!}$$ Can hyperbolic trig identies be used to solve these and if so how? Spoilers for A Storm of Swords / Season 4 episode 2 "The Lion and the Rose".  At the Purple Wedding,      Littlefinger and Lady Olenna Tyrell   perform their plan of      poisoning King Joffrey.   A short summary of their plan:  Littlefinger orders Ser Dontos Hollard to give Sansa Stark a beautiful silver hairnet adorned with amethysts. At least some of the amethysts are actually strangler crystals in disguise. Ser Dontos also, still under orders of Littlefinger, urges Sansa to wear the hairnet at the wedding, which she then does. At the wedding, when Lady Olenna greets Sansa, she fusses her hairnet a bit, while secretly taking one of the strangler crystals. Later, during the wedding, Lady Olenna puts the crystal in Joffrey's royal cup, poisoning him.  But why was their plan so complicated? Why couldn't Lady Olenna just bring a strangler crystal with her to the wedding (as suggested in )?  Then they wouldn't depend on Ser Dontos and Sansa who could unknowingly have done something to prevent the success of the plan.  The only reason that I could think of, is Littlefinger and Lady Olenna plan for Sansa (and Tyrion as her husband with her) to take the blame for Joffrey's death.  They put the crystals on her person, so that upon examination it would clearly show that Sansa had the murder weapon on her. But Littlefinger had a plan he did not tell Lady Olenna, namely rescuing Sansa during the chaos ensuing the murder (and thereby leaving Tyrion behind as the only accused).  Is there anything confirming or debunking this theory? If my theory doesn't hold up, is there another explanation for why the plan was so needlessly complicated? Is there a nice example of integral domain $R$ and $s,t \in R$, with $Rs \cap Rt$ not principal but lcm($s,t$) exists? I am currently searching for an integral domain $R$ which allows lcm, but where the intersection of two principal ideals is not necessarily a principal ideal (or at least an example with two certain elements).   As converse example (where the sum of two ideals is not principal but $R$ allows gcd) is $\mathbb Z[X]$. It allows gcd, but obviously $\left&lt;X+1,2\right&gt;$ is not principal.  An example of an integral domain where the intersection of two principal ideals is not principal would be $\mathbb Z[\sqrt{-5}]$ with the ideal $\left&lt;2\right&gt; \cap \left&lt;1+\sqrt{-5}\right&gt;$, but this doesn't allow lcm.  Since I can't find a nice example, I put the question here. Maybe someone has already seen this? (I am not completely sure, one even exists, but pretty certain there is an example. In the case my hunch is wrong, I would be happy, if someone could proof me wrong.)