I need to extract the substring between "Design Brands > " and the first following pipe(|) character from of the following string:  "T-shirts|Brands &gt; Port &amp; Company|Design Brands &gt; Montana Griz|Designs &gt; TeamLB Griz &gt; MTG31|T-shirts &gt; TeamLB|T-shirts &gt; Montana Griz"   This is within a google sheets function so I have to use Go's RE2 syntax  I would expect that the following expression would work  Design Brands &gt; (.*)\|   However, the expression matches everything up to the last pipe in the string  "Montana Griz|Designs &gt; TeamLB Griz &gt; MTG31|T-shirts &gt; TeamLB"  instead of everything up to the first occurance of a pipe in the string. I cant seem to figure out how to isolate just "Montana Griz" within a capture group.
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}?
Reward for Passing Review tests? Just wanted to see what the community thought of adding a reward to passing the review tests? Maybe a 1 point reward?  I know seeing the tests in the review area has helped me be extra careful when reviewing, but I thought perhaps a little boost in incentive would be cool. When do you use Java's @Override annotation and why? Read data from Excel file in Objective-C (iPhone) And when I tried the following commands /etc/hostnames and /etc/hosts, it says:  bash: permission denied. Is the below brief explanation correct and complete (at least in context)? Can it be improved/simplified without getting technical? I am especially concerned about the last sentence: Is that reasoning absolutely clear to a layman?            The problem can be viewed as drawing the above graph without lifting your hand and without retracing a line. Observe that each dot is connected by three lines. Also observe that you have to draw a line to arrive at a dot, and you have to draw a line to leave that dot. Because each dot is connected by three lines, each must be visited twice. But it is impossible to visit each dot twice (even number of times) and end up with each dot connected with three lines (odd number of times). Does going outside the range of the spell or breaking line of sight between the caster and target break concentration or otherwise affect control over the spell?  For example, a Heat Metal spell has a range of 60 ft. If I cast the Heat Metal spell on a an armored foe, and that foe runs outside the range of the spell (60 ft), or around the corner, does that break concentration and end the spell? Heat Metal also allows you to use a bonus action to cause the 2d8 of damage — would exercising that option be prevented by being out of range or line of sight? Is there a catch-all place on the Stack Exchange network where one can post any question that does not obviously belong to the Stack Exchange sites? Is there a catch-all place somewhere on the Stack Exchange sites where one can post a (any) question that does not obviously belong to any of the Stack Exchange sites?  Sometimes I have questions but I don't want to ask them on other sites (no need for names). I prefer to post it on the Stack Exchange network for various reasons.  If there isn't, are there plans for one? I imagine that if such a site exists, questions on that site can also be moved to other more specific sites when they exists, and it's not to be used to post questions which obviously belong to a specific Stack Exchange site. Unable to install Ubuntu on Lenovo Y500 How to re-enable tray icons for applications in Ubuntu? Why square the difference instead of taking the absolute value in standard deviation? Recover Data from Card that cannnot be read I am trying to help a friend who is very concerned that she has just lost all of the data on her 32GB SanDisk microSD card.  I told her I would post this and see if anyone could offer help.  Here are the details:   The SanDisk microSD card is less than two years old.  Probably only about a year old.  The store will take it back, but that doesn't really help.  She wants her data. She used the card in her Samsung Galaxy S4 smartphone for over a month.  The phone was never exposed to water or temperature extremes. Today, her phone suddenly said something like "Your SD card is blank or an unsupported format". Her phone was then unable to read the SanDisk microSD card at all.   Here's what she has tried:   Rebooting her phone.  Had no effect. Taking out the SanDisk microSD card and putting it inside a full-size SD card adapter, and inserting it into a Windows 7 SP1 computer.  The computer did not recognize its presence at all. Putting the SanDisk microSD card into a USB 2.0 external card reader and inserting the card reader into a USB port on a Windows 7 SP1 computer.  The computer recognized the card reader and installed drivers for it.  The card reader shows up as 'Removable Disk' in Windows Explorer.  Clicking on 'Removable Disk' in Windows Explorer results in the error "Insert disk: Please insert a disk into the Removable Disk". After trying #3, tried opening the 'Removable Disk' in FreeCommander.  Doing so results in the error "The device is not ready".   She does not have access to a linux box, but does have access to her Android phone.  What can she do to recover the data on her 32GB SanDisk microSD card? How do I create RAW TCP/IP packets in C++? I'm a beginning C++ programmer / network admin, but I figure I can learn how to do this if someone points me in the right direction. Most of the tutorials are demonstrated using old code that no longer works for some reason.   Since I'm on Linux, all I need is an explanation on how to write raw Berkeley sockets. Can someone give me a quick run down? How to get coloured terminal over ssh? When I connect over ssh to remote hosts everything is just a single font/color. I would like to have colours like I do locally e.g. green for executable and blue for symlinks etc. And such that when I run $ git diff on the ssh host it shows me diff with colours =) The TweakUI powertoy for Windows XP had an option to auto-login. It stored your password and did the login for you. This was useful, since you kept password protection, but had login programs loaded when you first booted.  When you switched users or hibernated, it would still ask for a password, which is the desired behavior.  Is there a way of doing this in Windows 7? How do I Deserialize this XML document:  &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;Cars&gt;   &lt;Car&gt;     &lt;StockNumber&gt;1020&lt;/StockNumber&gt;     &lt;Make&gt;Nissan&lt;/Make&gt;     &lt;Model&gt;Sentra&lt;/Model&gt;   &lt;/Car&gt;   &lt;Car&gt;     &lt;StockNumber&gt;1010&lt;/StockNumber&gt;     &lt;Make&gt;Toyota&lt;/Make&gt;     &lt;Model&gt;Corolla&lt;/Model&gt;   &lt;/Car&gt;   &lt;Car&gt;     &lt;StockNumber&gt;1111&lt;/StockNumber&gt;     &lt;Make&gt;Honda&lt;/Make&gt;     &lt;Model&gt;Accord&lt;/Model&gt;   &lt;/Car&gt; &lt;/Cars&gt;   I have this:  [Serializable()] public class Car {     [System.Xml.Serialization.XmlElementAttribute("StockNumber")]     public string StockNumber{ get; set; }      [System.Xml.Serialization.XmlElementAttribute("Make")]     public string Make{ get; set; }      [System.Xml.Serialization.XmlElementAttribute("Model")]     public string Model{ get; set; } }   .  [System.Xml.Serialization.XmlRootAttribute("Cars", Namespace = "", IsNullable = false)] public class Cars {     [XmlArrayItem(typeof(Car))]     public Car[] Car { get; set; }  }   .  public class CarSerializer {     public Cars Deserialize()     {         Cars[] cars = null;         string path = HttpContext.Current.ApplicationInstance.Server.MapPath("~/App_Data/") + "cars.xml";          XmlSerializer serializer = new XmlSerializer(typeof(Cars[]));          StreamReader reader = new StreamReader(path);         reader.ReadToEnd();         cars = (Cars[])serializer.Deserialize(reader);         reader.Close();          return cars;     } }   that don't seem to work :-( Firstly my main goal is to try and get FTP files recursively in Centos.  However the actual FTP login contains an @ which ruins the syntax.  Is there some way to place the username in "double quotes" or some such equivalent such that I can use @in the username? What does the Code of Conduct say about pronouns? Please leave any feedback or questions about this FAQ on .     Two weeks ago, we  to directly address concerns over pronoun usage. We tried to anticipate likely questions, but&hellip; missed the mark by quite a lot. Based on Gareth McCaughan’s excellent post, “”, we’ve gone back to the drawing board and written a new FAQ that aims to address actual questions that have been frequently asked in these discussions.  If you read only one thing, the answer to question #1 under The Basics sums up our goals in publishing this guidance:     It would be rude to refer to a man as "she" or a woman as "he". Some people are neither male nor female and might, for instance, ask to be referred to as "they". When someone indicates what pronouns should be used to refer to them, please use the pronouns they state as you would others.   This is a learning process for most of us - from authors to readers to moderators to employees of Stack Exchange, Inc.  Let’s all try to approach this with good intentions and a willingness to learn from one another.  Big thanks to Gareth for leading by example here, and to everyone who has stepped up to ask and answer the important questions!  What's all this stuff about pronouns in The Code of Conduct?  The  has two direct references to pronouns:   “Use stated pronouns (when known).” “Prefer gender-neutral language when uncertain.”   What does all of this mean and how can I as a user understand and follow the CoC guidance? How do I make a 2D game resolution independent? I'm working on a simple 2D game. I've finished the mobile phone version.  However, my boss wants the game to works on his RT. I'm doing the "conversion" but my buttons are in the wrong places, because I hard-coded the screen size, like this:   texture = game.Content.Load&lt;Texture2D&gt;("StartScreen");  mainFrame = new Rectangle(0, 0, game.GraphicsDevice.Viewport.Width, game.GraphicsDevice.Viewport.Height);   // button definitions  startbrect = new Rectangle(300, 258, 88, 88);  startbtext = game.Content.Load&lt;Texture2D&gt;("bplay");   In this example, mainframe is fine, but startbrect isn't, because I defined the size to match a Windows phone's screen. How can I handle responsive design when all Windows 8 phones' screens are different? Is there a formula or macro to calculate each time the good size? Automatically growing lists as in MATLAB? Is doing two PhDs a good path? I am studying a combined bachelor of engineering (electrical) and bachelor of mathematics; I just started this year and will graduate in 2018. The reason why I am doing double degrees and not a single degree is because I love both electrical engineering and mathematics and I could not ignore any of them. So with this in mind, I am thinking of doing two PhDs when I graduate (one in electrical engineering and one in mathematics). Is this a good path or I should concentrate on only one of them?