i have this string pattern:  Name: bondy address: kuta, bali age: 20   i want to get the name value of Name i did regex like this:  /(?&lt;=Name:)(.*)(?=[\n\r])   but somehow it reads until the last newline?  demo:
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}?
I am running Xubuntu 11.10 and everything works nicely. I have selected a nice Xfce theme and everything looks beautiful, except Libreoffice.  While other programmes (Gimp, Inkscape, Thunar etc.) integrate with the selected Appearance &amp; Window Manager theme, Libreoffice looks like a Windows 98 programme.  Does anyone know how to fix this? I have already tried this solution, without success:   Thanks for your help! Is "can not" unambiguous? I always try to remember to use "cannot" when applicable as in "I cannot take an umbrella" (because I do not have one).  I also thought that the problem with "I can not take an umbrella" was that it was ambiguous: it could also mean that I could decide not to take an umbrella. Trying to write unambiguously most of the time, I would therefore never use it.  Now I see it claimed that it is in fact not ambiguous, and only carries the second meaning. Usually I would accept such advice at face value and start using "can not" when the second meaning is unambiguously meant, but this comes from a style guide I have other reasons not to respect very much.  Does "can not" have a single unambiguous meaning?  (I have read  but my question is more about current usage. The length of the answer to that question does confirm my prejudice a bit, though) Correct use of 'with' or 'at' when talking about percentages? I'm writing the following sentence:     Women lead uptake at XX%.   But a friend is saying that it should be written:     Women lead uptake with XX%.   Which one is correct? How to repair Ubuntu installation after interrupted dist-upgrade without losing any custom settings? How do I open the Dahl chest in Sanctuary? I want to remove all empty lines from a file. Even if the line contains spaces or tabs it should also be removed. Soundness vs completeness, am I understanding? And proving soundness? BGE everything white in playmode When I press P to play everything shows up white in the BGE. Shading is set to GLSL, and the objects are UV mapped and textured. It seems that vertex paint is overriding the material for the object even though it is unchecked in the material options.   Shading is set to GLSL   Objects have a texture applied How to print line numbers to the log. Say when outputting some information to the log, I also want to print the line number where that output is in the source code. As we can see in the stack trace, it displays the line number where the exception has occurred. Stack trace is available on the exception object.  Other alternative could be like manually including the line number when printing to the log. Is there any other way? How do I use shell variables in an awk script? Strange noise when moving files When I move files, a small 'noise' noise comes through my headphones or speakers.  It only happens when moving files.  Is there a reason why moving files causes this slight static?  It only lasts for as long as the files are moving.  I'm not as much as annoyed as I am curious.  It is a Gigabyte board with a integrated sound card.  I'm running Windows 7.  I don't think it used to do this but I'm not quite sure. Why not use exceptions as regular flow of control? $n!+1$ being a perfect square One observes that  \begin{equation*} 4!+1 =25=5^{2},~5!+1=121=11^{2}  \end{equation*} is a perfect square. Similarly for $n=7$ also we see that $n!+1$ is a perfect square. So one can ask the truth of this question:   Is $n!+1$ a perfect square for infinitely many $n$? If yes, then how to prove. I want to remove the URL that gets printed on the bottom of the page.   like:  yomari.com/.../main.php?sen_n   How can it be omitted or prevent from getting printed?  To be more specific, is there any way I can prevent the page URL, date and the page title being printed along, while printing the web page? Is it possible to create bootable linux on USB drive using windows command line? I don't mean people with low self esteem.  But there are people who feel happy at being able to make other people laugh at their own expense. I remember someone telling me there is a word for them, I can't find it.  Let me explain:  I sometimes, while sitting with a group of people, might just tell them a personal embarrassing story, which might be completely fabricated, to make other people laugh. And when they laugh, I feel happiness.  I'm also self deprecating, but not in a way that I hate myself, rather,  just my work (I'm a screenwriter) and knowing I can do better. I do not self deprecate myself in public (I don't praise myself either).   Edit: Now that its mentioned, I think the word I'm talking about was used to describe a person's sense of humor. Or it could be a word used to describe a psychological trait/disorder.  Edit: I just looked up humor styles on Wikipedia. And after reading it, I guess the word that closely matches what I'm looking for is 'Affiliated Humor' but in a 'Self Defeating' style. PostgreSQL Shapefile import failed I am very new to PostGIS/PostgreSQL. In fact, I downloaded it because of the answers I got to this question:   I installed both PostgreSQL and PostGIS. But I am not able to import a shapefile to the database? It gives an error, "Shapefile import failed". What am I doing wrong? Why can't a single photon produce an electron-positron pair? In reading through old course material, I found the assignment (my translation):     Show that a single photon cannot produce an electron-positron pair, but needs additional matter or light quanta.   My idea was to calculate the wavelength required to contain the required energy ($1.02$ MeV), which turned out to be $1.2\times 10^{-3}$ nm, but I don't know about any minimum wavelength of electromagnetic waves. I can't motivate it with the conservation laws for momentum or energy either.  How to solve this task? How do you clone an Array of Objects in Javascript? How to check if click event is already bound - JQuery