Regex: Match everything until first occurrence of two alternatives I have the following regex:  (?i:outer|inner ){0,1}(?i:JOIN (tableC|tableG) AS )([a-zA-Z0-9\r\n ~()=&lt;&gt;#_'"-])*(?=(?i:JOIN|WHERE))   I am testing this against this SELECT statement:  SELECT columnA FROM tableB AS B INNER JOIN tableC AS C ON B.fieldC = C.fieldC  INNER JOIN tableD AS D on C.fieldD = D.fieldD WHERE D.fieldE = C.fieldE   Now, I want the regex to match INNER JOIN tableC AS C ON B.fieldC = C.fieldC INNER. However, it matches until the first occurrence of WHERE. INNER JOIN tableC AS C ON B.fieldC = C.fieldC INNER JOIN tableD AS D on C.fieldD = D.fieldD  I am quite confused as I clearly stated in the regex to positively lookahead for a WHERE or a JOIN. However, it seems to be looking up until the last occurrence of any of these alternatives? Can anyone give insight on what's wrong and why is this happening to my regex?  Thanks!
My regex is matching too much. How do I make it stop? 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}?
User  answered the wonderful  question by mentioning the using keyword. Can you elaborate on that? What are the uses of using? How to disable automount in nautilus's preferences Why is there free space at the end of NTFS Partitioned Drives? I've been wondering this for a while, why is there free space at the end of a drive that was formatted to NTFS in windows?  You can only see the unallocated space in Linux. So why is it there? Does it serve a purpose? Should we write “allow” or ”allows” in “require that the class allow[s]”? Can you explain to me whether I should or should not use ‑s at the end of the  verb allow in this sentence?     This function requires that the container class allow[s] random access   The sentence in the book I read wrote allow without ‑s. However, the container class is a third-person singular, so the ‑s must be required. Is that right? Better explanation of the common general relativity illustration (stretched sheet of fabric) If $(Tx \mathbin{|} x) = 0$ for all $x$ then $T = 0$ Let $T$ be a linear operator on an inner product vector space $V$. I'd like to prove that if $$(Tx|x)=0 \quad \forall x \in V$$ then $T$ is the null operator. I can't figure out this proof using contradiction, do I have to choose an appropriate vector? Let $q_1,q_2,q_3,q_4$ be orthonormal vectors in $\mathbb{R}^4$,$z_1,z_2,...,z_6$ orthonormal vectors in $\mathbb{R}^6$ and $A=z_1q_1^T + z_2q_2^T$. Let $q_1,q_2,q_3,q_4$ be orthonormal vectors in $\mathbb{R}^4$,$z_1,z_2,...,z_6$ orthonormal vectors in $\mathbb{R}^6$ and $A=z_1q_1^T + z_2q_2^T$.  a) Find the base and dimension of fundamental subspaces of matrix A  b) Using the results given by a) find the general solution for $Ax - z_1$.  Any hint would be appreciated. Creating checkbox parameter in Python script tool for ArcGIS Desktop? I am working on creating an ArcGIS tool from a Python script I am writing.  I am wondering if it is possible to have a checkbox parameter.    I want to have a parameter where the user selects a feature class, then from the feature class the user will choose the field for the upper most layer in their model, then I want the user to be able to choose what layers they want the script to run on with a checkbox structure derived from the upper most layer field.    Is this possible with python, and ArcGIS Desktop? HTML form readonly SELECT tag/input According to HTML specs, the select tag in HTML doesn't have a readonly attribute, only a disabled attribute. So if you want to keep the user from changing the dropdown, you have to use disabled.  The only problem is that disabled HTML form inputs don't get included in the POST / GET data.  What's the best way to emulate the readonly attribute for a select tag, and still get the POST data? Where can I find stock or custom ROMs for my Android device? What medium should be used for long term, high volume, data storage (archival)? Is there a general theorem stating why the restricted Lorentz group's exponential map is surjective? The exponential map for the restricted Lorentz group is surjective. An outline of why is shown on the wiki page .  Is there a more general theorem that states that for some class of Lie groups or Riemannian manifolds (which includes the restricted Lorentz group), the exponential map is surjective?  There is a theorem stating that compact, connected Lie groups have surjective exponential maps. But as the restricted Lorentz group is not compact, this isn't applicable. If $\alpha$ is an algebraic element and $L \subset K$ are both field, does the polynomial ring $L[\alpha]$ is also a field?  I am trying to prove that the ring of fraction $L(\alpha)$ is equal to $L[\alpha]$. To do this, I use an exercise done in class : Let $K$ a field, $\alpha \in K$ and $L$ a subfield of $K$. Then $L(\alpha)$ is the smallest subfield of $K$ containing $L$ and $\alpha$.  Is anyone could help me? I've been using mkvmerge to merge a video file and subtitles, I'm using the following command  mkvmerge -o output.mkv video.mp4 subtitles.srt   Which is working fine but as you can probably guess this is really slow operation   I've to open terminal in every one of those directories where movies are stored. Then I've to copy and paste the names of the files in the command Then I've to rename the output file Then delete the original files which I used   This is a lengthy process.     Ideal situation that I want.   I'll go into the folder which contains a movie file and a subtitle file with the same name. I select a movie file and and a subtitles file, right click and run a nautilus script on them. They get merged Original file gets deleted. Rename the merged file with the name of the orignal file with mkv extension      This doesn't need to be recursive, I don't want my HDD creating and deleting 100's of files at ones. Movie files and Subtitle files generally have the same name but some times have "_en" post fixed to subtitle files. If you have another approach of doing it I'm on board with that too. How to provide a file download from a JSF backing bean? If $|G/H|=4$ then $G$ is union of three proper subgroups Let $G$ be a finite group and $N$ a normal subgroup of $G$ of index $4$. Prove that $G$ has a subgroup of index $2$ (hence normal) and if $G/H$ is not cyclic then $G$ is equal to the union of three proper subgroups.   I understand that $G/H$ is isomorphic to $\mathbb{Z}_4$ or $\mathbb{Z}_2\times \mathbb{Z}_2$. Let $K^*$ be a subgroup of $G/H$ of order $2$. Then $K^*\cong K/H$ for some $K$ such that $H$ is normal in $K$ and hence $[G:K]=[G/H:K/H]=4/2=2$.  If $G/H$ is not cyclic then $G/H\cong \mathbb{Z}_2\times \mathbb{Z}_2$. I don't know how to prove $G$ is the union of three subgroups. Could it be true that as $G/H$ is the union of three proper subgroups $K_1^*,K_2^*,K_3^*$ then the corresponding groups $K_1,K_2,K_3$ have union equal to $G$? Would anyone give me a hint to prove this?  Thank you. Recently I've been messing around with making a few minigames, and have used a few plugins to help make it easier to create and run them. However, a newer one I'm making requires me to use the /summon command in order to spawn zombies. However, no matter what I put in, I can't spawn hostile mobs. All other entities still spawn perfectly fine. Strangely, the /spawnmob command which comes with Essentials can summon hostile mobs fine. I would rather use /summon since it's more customizable though. Here's a list of plugins I have installed.   Essentials EssentialsChat HolographicDisplays PermissionsEx setspawn [A plugin I have made, just a simple timer] Vault VoxelSniper WorldEdit WorldGuard   Please let me know if you have any ideas on what I'm doing incorrectly or isn't functioning the way it should. Optimized rendering of a cube mesh world I want to render a cube-mesh (a.k.a. Minecraft-style) world. If I render each existing cube it will eat up FPS pretty quickly. How can I optimize it? I understand that the point is to not render invisible meshes (faces?) but my problem is to find out what is invisible and what isn't. Unmangling the result of std::type_info::name revoking apex managed sharing permission I'm using apex managed sharing to grant permissions very similar to how it is done in this example trigger:   However, I also need the ability to revoke or delete this access and having it revert to private. The reason for this is my understanding is that there are only two access options for managed sharing access 'read' or 'edit' with no 3rd option of 'none' or 'private'.  Reference:   I've tried adding the shares to a list and deleting the list and I'm getting the error: DELETE_FAILED, cannot delete owner or rule share rows,   I also noticed there is a field on the share object 'isDeleted' this field however is not writable.  Does anyone have experience revoking or deleting these permissions once they've been created?  Thanks!