I'm trying to learn RegEx and tried to solve the below scenario:  Assume the the below string is a cell in a data input with thousands of rows:  "He who sleeps on the floor will not fall off the bed.Robert Gronock16-APR-2005This is a valid record."   I wrote the Regex ".+\s*(\d+-.+-\d+|[[:alpha:]]{3}\s*\d+,*\s\d+)" to extract the date only from the string but what I get is 6-APR-2005 missing the 1 at the beginning.  I don't want to use {2} as some rows has single digit like 8-Apr-2005 and it would return Null.  What I am doing wrong in the RegEx?
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}?
Should I use Named Pipes, or .NET Remoting to communicate with a running process on my machine? How delete an application that is bundled with macOS? Backstory:   I am running macOS Sierra and use TextEdit a lot. The problem is that I hate the Versions save schema that causes the universal Save As shortcut of CmdShiftS to instead create a copy of the document. I also hate how Auto-Save makes permanent changes to documents I don't want to modify when I'm tentatively modifying a work-in-progress. Since the introduction of these nuisance features in Lion I have always backed up and then replaced TextEdit.app with the legacy 1.6 version from Snow Leopard.  The problem:  Today when I tried to delete TextEdit.app from my Applications folder using this Terminal command  sudo rm -rf /Applications/TextEdit.app   I got this error  rm: TextEdit.app: Operation not permitted   I was surprised to find that I can't kill it, even with sudo.  How can I actually get rid of an application that is bundled with macOS?  What I've tried so far:  I followed the instructions in , but it didn't work. I also read , which almost accomplishes the same solution by means of disabling Versions and Auto-Save, but then I don't get the benefit of legacy TextEdit's temporary backup saving feature. See the part in the answer stating "This effectively disables the old-style, pre-Lion autosaving completely".   So I think deleting the newer TextEdit v1.12 and replacing it with the legacy v1.6 is still the best option, however I can't get my system to delete it. Any help appreciated. I'm an Indian. I'm planning to book a journey from Mumbai to Johannesburg, South Africa and back (conference visa). I looked at refundable tickets, while they are priced higher, they give you half your money back, for instance if the to and fro flight costs INR 40,000 they give you INR 20,000 . But this is if you are cancelling for some reason.   What if you have to cancel because your visa application or the transit visa application got rejected. As far as I understand the procedure is :-  a. Buy airline tickets   b. Apply for Visa   c. Wait between 1-6 weeks to get update about your visa application, for both visa and transit visa (although transit visa should be shorter I guess.)  d. If visa is granted then move on to planning other things about the trip.   Now in case, if the visa application fails (for whatever reason ) what recourse does the traveler have ?  Are there any airlines who are better understanding than others about this situation ?  In non-refundable tickets, I guess that all is lost or is there some way to save money there too.   Lastly, I read travel insurance can help in this case. How does travel insurance help in the above scenario ?  Edit :- One of the pre-conditions of getting the visa is   Proof of a Valid Return or onward ticket or purchase of ticket. This is from   and Why are there holes in the icing? I tried to follow the new Blender 2.8 tutorial from Blender Guru.   When entering "Sculpting" with the icing there were suddenly alot of holes in it. Why is this? List of Ubuntu Versions with Corresponding Linux Kernel Version A function for which one-sided limits are zero and infinity As far as I know, current division for spesific place's formula is: Ix=(Req/Rx)*Isource   However, here,the solution is 3/(3+2+4)*6. How is this a current division ? Can you explain this to me What are the effects of exceptions on performance in Java? Mac-like alt-tab replacement for Windows 7? Is there an alt-tab replacement for Windows 7 that works in the same manner as command-tab and command-tick (tilde) on OS X?  Requirements:  1. Completely keyboard-shortcut-based, no mouse action should be necessary.  2. 2 keyboard shortcuts with the following behavior:  a.) alt+tab:       cycles through open applications (NOT windows... applications, meaning even if i have 10 firefox windows open, I only want to see firefox once in the list that comes up when i hit this shortcut)  b.) alt+`:     cycles through WINDOWS that are instances of the currently active application (meaning if firefox is my active window and i hit shortcut2, it will cycle through those 10 firefox windows, while ignoring any other windows from ANY other application).    Update 08:40 5/21: I tried out eidylon's suggestion, TopDesk.  It doesn't provide any of the functionality described here.  Other apps I've already tried:   VistaSwitcher Switcher Dexpot (awesome app, still using, but doesn't do what I want in this case... also looked for plugins but couldn't find one that does it) UltraMon Nvidia nView   update: Unfortunately I still haven't found a solution for this.  update: made this a community wiki in case anyone is ever able to find a solution for this. Correct usage of 'but for'? Does 'but for' mean:  'If we had X (but we didn't), Y would have been the consequence'?  Or can it also mean; because we had X, as a result Y happened?   Some different examples of but for:  (Case 1)     But for a cup coffee, it was to be a productive day of writing.   Unfortunately, I'd run out, and spent the day craving.    (Case 2)     But for the glass of wine I had dinner, the house work didn't get   done.   (Case 3)     But for the glass of wine I had for dinner, I would have got the   house work done   What is the correct usage of "but for"? My cursor is moving by every selection by large increments!  Normally when I use Blender, I am able to select and move objects to any coordinate. Now, all of the sudden, when I select an object or mesh the selection moves by an inch or so in each direction.  How do I reset it to normal? The Safari app has disappeared from my iPhone? I can't find the safari icon on my iphone 4?  I have tried resetting home screen layout and that doesn't work.  My restrictions button is 'on' and it asks for a password for this button.  I don't have a password.  Can you help? Thanks, Sort file by group of lines If I have a file with contents similar to:  FirstSection     Unique first line in first section     Unique second line in first section  SecondSection     Unique first line in second section     Unique second line in second section  ...  NthSection     Unique first line in Nth section     Unique second line in Nth section   Is it possible to use unix commands (e.g. sort, awk) to sort the file alphabetically by the first non-indented line in each three line group, whilst keeping the indented lines under their existing group? How much money do I need to show as proof of support when applying for a UK Standard Visitor visa? Proof that $\frac{a^2}{b} + \frac{b^2}{c} + \frac{c^2}{a} \geq a+b+c$ I've tried getting everything on the left side and transforming it into something squared so that I can prove it's bigger or equals to 0 but I've been unsuccessful. I'm trying to prove that for $p,q&gt;0$, we have $$\int_0^1t^{p-1}(1-t)^{q-1}\,dt=\frac{\Gamma(p)\Gamma(q)}{\Gamma(p+q)}.$$    The hint given suggests that we express $\Gamma(p)\Gamma(q)$ as a double integral, then do a change of variables, but I've been unable thus far to express it as a double integral.  Can anyone get me started or suggest an alternate approach?  Note: This wasn't actually given to me as the $\Gamma$ function, just as a function $f$ satisfying $$f(p)=\int_0^\infty e^{-t}t^{p-1}\,dt$$ for all $p&gt;0$, but I recognized that. This is in the context of an advanced calculus practice exam. What does a Terminator do after its mission is accomplished? A Terminator is essentially given a mission or an objective ("Go back in time and kill Sarah Connor" or something of the like).  What does a Terminator do once its mission is accomplished?  We see in Terminator 2: Judgment Day (the live-action movie) that the  (played by Arnold Terminator Schwarzenegger) completed its mission of protecting the Connors, and then sort-of just melted itself into nothingness (presumably to protect the world from discovering Terminators again).  But what would the  or the  (in Terminator 3) have done?   Are they given multiple directives ("Go kill Sarah Connor, then go kill Robert Baratheon, and then have a nice hot bath; you've earned it")?  This question is related, but not a dupe: What should be created first in a video game? Associated Prime Ideals in a Noetherian Ring; Exercise 6.4 in Matsumura Let $I$ and $J$ be ideals of a Noetherian ring $A$. If $JA_P\subseteq IA_P$ for every $P\in \operatorname{Ass}_A(A/I)$, then $J\subseteq I$.   I'm reading Matsumura's Commutative Ring Theory book on my own. This is exercise $6.4$ in that book, and I fail to prove it. Could you help me with this? Thanks in advance. Showing equality of sequence of holomorphic functions to limit function if converges uniformly locally I do not know how to proof following question:  Let $D$ be a domain in $C$.  ${{f}_{n}}$ be a sequence of holomorphic functions on $D$ that converges uniformly locally to a function non-constant $f$. Show that for each $z\in D$, there is a sequence ${{z}_{n}}\to z$ as ${{f}_{n}}({{z}_{n}})=f(z)$ for all sufficiently large $n$.  Actually, I know that I should use an assumption such as: ${{f}_{n}}({{z}_{n}})\ne f(z)$  Therefore, there is compact set    that  $\left\| {{f}_{{{n}_{k}}}}({{z}_{{{n}_{k}}}})-f(z) \right\|&gt;\varepsilon $  Then I think I have to use Montel theorem, but I do not know how to show the contradiction.