Here are my test cases.  Expected:  JUNKINFRONThttp://francium.tech should be http://francium.tech JUNKINFRONThttp://francium.tech/http should be http://francium.tech/http francium.tech/http should be francium.tech/http (unaffected)  Actual result:  http://francium.tech francium.tech/http http   I am trying to write a regex replace for this. I tried this,  text.sub(/.*http/,'http')   However, my second and third test cases fail because it searches till the end. It would help if the answer could also do the case insensitivity.  2.5.0 :001 &gt; url = 'francium.tech/http'  =&gt; "francium.tech/http"  2.5.0 :002 &gt; url.sub(/^.*?(?=http)/i,'')  =&gt; "http"
I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?
Given a set of curved geodesics in 2D space, is there a way to determine the geometrical shape of said space? Passing an array as a function parameter in JavaScript This button is in the new Firefox, but what is the name of it? Do I need the original discs to install WoW on a new computer? My boyfriend bought the World of Warcraft Battle Chest, Wrath of the Lich King, &amp; Cataclysm. He downloaded them to our previous computer, but now we have a new one and when he took out the first disk from the battle chest he severely scratched it. Anyway, I tried putting in disk #2, and it said I couldn't do it without disk 1 (which is scratched!).  I've recently put in Wrath of the Lich King (it came with 2 CDs), and it said that I haven't downloaded the original and asked me if I wanted to downloaded. I clicked "yes" -- does that mean its downloading WoW &amp; The Burning Crusade? Or do we need to buy it all again?  We just bought the whole set on June of this year... How to re-link missing blender files I have multiple characters linked to a blender file, but i moved the original character files and now blender is sating they're missing.  Is it possible to get blender to find the missing blender files like it finds missing image files so that i can preserve the previously made animation?  On a side note is there a way to also view a list of all the missing files? Presentation $\langle x,y,z\mid xyx^{-1}y^{-2},yzy^{-1}z^{-2},zxz^{-1}x^{-2}\rangle$ of group equal to trivial group Problem: Show that the group given by the presentation $$\langle x,y,z  \mid xyx^{-1}y^{-2}\, , \, yzy^{-1}z^{-2}\, , \, zxz^{-1}x^{-2} \rangle $$ is equivalent to the trivial group.   I have tried all sorts of manners to try to show that the relations given by the presentation above imply that $x=y=z=e$. However, I am stuck and would appreciate any hints as to how I should move forward. Let $f:\mathbb{R}\rightarrow \mathbb{R}$ be continuous.Let $t\in\mathbb{R}$. Evaluate:$\lim_{h\rightarrow0}\frac{1}{h}\int_{t-h}^{t+h}f(s)ds$ Get it? vs Got it? What the heck are you doing? Stop that nonsense. Get it?     What the heck are you doing? Stop that nonsense. Got it?    Which one of the above is correct? Is it okay to use just "Get it?" or "Got it?" instead of "Did you get it?" or "Have you got it?" in informal spoken English? How can one show there is no holomorphic function $f$ on the open unit disc $\mathbb{D}$ such that it extends continuously to $\frac{1}{z}$ on $\partial\mathbb{D}$? I mean $f$ takes value $\frac{1}{z}$ when $|z|=1$ and continuous here.  Thank you. When does the amount of skew or prevalence of outliers make the median preferable to the mean? I know that "deviations in the data are devil", and when the distribution is highly skewed, it is better to consider median as average rather than mean, but how to decide these hard-limits.  For example:   CASE 1:   Assume X = 10,20,30,40,50,60,70 In this case, I think that it is better to use mean and that it will give very accurate results.  CASE 2:   Assume X = 10,20,30,40,50,60,70,7000 In this case, I think that it is better to use median instead of using the mean.  CASE 3:    Assume X = 10,20,30,400,500,600,700 In this case, I think it is better to use IQR (Inter Quartile Range)    But I'm stuck with how to decide these hard-limits i.e. which to use in which condition, in general.   I've found a tool working on subjected principle, which takes context-less sample-distribution as input and determines whether mean is close/moderate or against the null-hypothesis.  Find References:-     (For Mean Test)  (For Median Test)   What I'm really looking is a good answer which states how to derive these conclusions. Casting two cantrips, both modified by metamagic? Can you cast one cantrip, modifying it with "Twinned Spell" (Fire Bolt) to target 2 creatures, and then cast another cantrip as a Bonus Action (Fire Bolt), using "Quickened Spell" to target one of the previous creatures or another creature? I hear so many terms involving the word "linear". Linear function, linear equation, linear system, linear operator, linear transformation, linear mapping, linear space, linear algebra, linear electrical circuits, linear filters, linear electrical elements, linear approximation, linear optimization.  I'm getting crazy trying to understand the application of the "linear concept" to all this aspects (function, equation, mapping, system, operator, transformation, algebra, etc.) and I wish to know the one essence that is to be linear. What something has to be to be linear? If I say something is linear, what do I know for sure about that something (no matter what the something is)?       I heard a definition of linearity is by homogeinity (scaling the input results in a scaled output) and addition (summing the inputs results in summing the outputs). Can I apply this simple definition to all the branches (operator, mapping, system, transformation, algebra, ...) I mentioned ? Do they all behave like a line ?  y = ax + b, for example, is a line but doesn't behave like a line because y is not linear. How can I prove that if $n$ is even then $n^2$ is even and if $n$ is odd then $n^2$ is odd? Possible Duplicate:          I am always confused with the prepositions to use when indicating an event happening at a place. Should I use "at" or "in" or "on"?  For example:     We had our dinner at the McDonalds at/in the shopping centre at/on Sixth   Avenue.   The McDonalds restaurant is in the shopping centre. The shopping centre is located at Sixth Avenue. So am I right to say "the McDonalds in the shopping centre at Sixth Avenue"?  Now, what if it was a street instead of an avenue? Say for example:     We had our dinner at the McDonalds at/in the shopping centre at/on Coral Street.   Here, somehow, I find it natural to say "the McDonalds at the shopping centre on Coral Street".  How do I determine the right prepositions to use? And how would the different prepositions give different meanings to the sentence? How do I  prevent .xsession-errors from eating disk space? Example to show the distance between two closed sets can be 0 even if the two sets are disjoint Let $A$ and $B$ be two sets of real numbers. Define the distance from $A$ to $B$ by $$\rho (A,B) = \inf \{ |a-b| : a \in A, b \in B\} \;.$$ Give an example to show that the distance between two closed sets can be $0$ even if the two sets are disjoint. Why do some Kree have white skin? This seems bizarre to me.  All the Kree we've seen thus far (MCU based) were blue skinned... Ronan the Accuser being the most famous  What do Kree people look like?  Is there anything concrete with their appearance?  It seems odd that Danvers (Captain Marvel) and Jude Law's character (Yon-Rog?) and the "Supreme Intelligence" are all white skinned. How to validate an email address using a regular expression? 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 understand the proof that  $$Var(aX+bY) = a^2Var(X) +b^2Var(Y) + 2abCov(X,Y), $$  but I don't understand how to prove the generalization to arbitrary linear combinations.  Let $a_i$ be scalars for $i\in {1,\dots ,n}$ so we have a vector $\underline a$, and $\underline X = X_i,\dots ,X_n$ be a vector of correlated random variables. Then $$ Var(a_1X_1 + \dots a_nX_n) = \sum_{i=1}^n a_i^2 \sigma_i^2 + 2 \sum_{i=1}^n \sum_{j&gt;i}^n a_i a_j \text{ Cov}(X_i,X_j)$$  How do we prove this? I imagine there are proofs in the summation notation and in vector notation? Inform users of certain tags on the existence of a new SE-2.0 site and offer to automatically post the question there instead Take for example  both at SO and SU. Now that there's , (new) users asking a LaTeX question should at least be informed that there is a new Stack Exchange site dedicated to TeX and thus increases their chance of an answer. This should happen before the question is actually posted and ideally offer the option to post the question directly there instead (without the need to copy-paste).  LaTeX is just an example, there's also , ,  etc., and it is obvious that this can only be decided on a case-by-case basis which is why I certainly do not suggest migrating questions automatically when these tags are used. But informing users of that possibility would probably help the SE network in general.