I need a greedy regex to select everything between curly braces but not the starting and ending curly braces  for example:   {here {first} and {second} and {third}}   output should be  {first}, {second}  {third}
919
Unfortunately, despite having tried to learn regex at least one time a year for as many years as I can remember, I always forget as I use them so infrequently. This year my new year's resolution is to not try and learn regex again - So this year to save me from tears I'll give it to Stack Overflow. (Last Christmas remix).  I want to pass in a string in this format {getThis}, and be returned the string getThis. Could anyone be of assistance in helping to stick to my new year's resolution?    Related questions on Stack Overflow:
5915
I know it's possible to match a word and then reverse the matches using other tools (e.g. grep -v). However, is it possible to match lines that do not contain a specific word, e.g. hede, using a regular expression?   Input:  hoho hihi haha hede   Code:  grep "&lt;Regex for 'doesn't contain hede'&gt;" input   Desired output:  hoho hihi haha
21492
Using the following command, could someone please explain what exactly is the purpose for the ending curly braces ({}) and plus sign (+)?  And how would the command operate differently if they were excluded from the command?  find . -type d -exec chmod 775 {} +
18468
I'm developing an algorithm to parse a number out of a series of short-ish strings. These strings are somewhat regular, but there's a few different general forms and several exceptions. I'm trying to build a set of regexes that will handle the various forms and exceptions; I'll apply them one after another to see if I get a match.   One of these forms goes something like this:  X (Y) Z   Where:   X is a number I want to capture.  Z is static, pre-defined text. it's basically how I determine whether this particular form is applicable or not. Y is a a string of unknown length and content, surrounded by parenthesis.    Also: Y is optional; it doesn't always appear in a string with Z and X. So, I want to be able to extract the numbers from all of these strings:   10 Z 20 (foo) Z 30 (bar) Z   Right now, I have a regex that will capture the first one:  ([0-9]+) +Z   My problem is that I don't know how to construct a regex that will match a series of characters if and only if they're enclosed in parenthesis. Can this be done in a single regex?
3211
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}?
71442
How do I put big brackets under different parts of an equation so that I can write, e.g., text specific to these parts? For example: f =  x^3 +  2     |___|  |__|        |     |    text 1  text 2
120384
How can I trim a file (well input stream) so that I only get the lines ranging from the first occurrence of pattern foo to the last occurrence of pattern bar?  For instance consider the following input :  A line like foo this  foo bar something something else foo bar and the rest   I expect this output:  foo this  foo bar something something else foo bar
106744
In bash, {a..d} expands to a b c d. Currently this is not happening for me in zsh, and my googling has returned conflicting results.  Some results suggest that {a..d} should work -  The other result I found is from the zsh mailing list which suggests setopt braceccl to get letter ranges using {a-z}. This works, but I'm wondering whether I've misread the Brace-Expansion link, or whether there's something else to consider.  Importantly, I'm using the zsh-grml config, which is probably adjusting a variety of expansion options, but I'm hesistant to start digging through because it's massive, and a cursory grep brace ~/.zshrc doesn't reveal anything.
123694
I want to search for string that have  [RT]"anything"D  which mean first character can either be R or T  and the next can be anything until D is appear what should I use is it "egrep"?
2704
Obviously, you can use the | (pipe?) to represent OR, but is there a way to represent AND as well?  Specifically, I'd like to match paragraphs of text that contain ALL of a certain phrase, but in no particular order.
95809
When doing a search, posts with MathJax code are wrongly formatted.  In this example  all the results look ugly. When taking a closer look at the first post, I notice that the first $ is not regocnized by MathJax as a math-begin, while the second $ (that should denote math-end) is taken as the beginning of math.    Another example:
105509
In many equation editors (e.g. MS Word 2007 and Daum Equation Editor), there's a double square bracket. Is there a TeX equivalent for [[, ((, )), and ]]?
62677
I am writing a Java utility which helps me to generate loads of data for performance testing.  It would be really cool to be able to specify a regex for Strings so that my generator spits out things which match this.  Is there something out there already baked which I can use to do this?  Or is there a library which gets me most of the way there?  Thanks
33685
Pretty basic question, I'm trying to write a regex in Vim to match any phrase starting with "abc " directly followed by anything other than "defg".   I've used "[^defg]" to match any single character other than d, e, f or g.  My first instinct was to try /abc [^\(defg\)] or /abc [^\&lt;defg\&gt;] but neither one of those works.
96808
Speaking of tilesource urls such as   http://{s}.tile.stamen.com/watercolor/{z}/{x}/{y}.png  is there any technical documentation or canonical reference for the curly braces syntax?  I'd specifically like to know what other things can be used in curly braces, and in which places, and how they work.
116235
Trying to write -regex for a find statement that shows only directories with dots and numbers, for example 1.2.3.4 oraz 1.2.3 or 1.3.4.5.6 was trying something like  "-regex '\.[0-9.]+'", but it also shows dirs with letters. And I only want directories with numbers and dots.
50593
I am looking for a regex that will find repeating letters. So any letter twice or more, for example:  booooooot or abbott   I won't know the letter I am looking for ahead of time.   This is a question I was asked in interviews and then asked in interviews. Not so many people get it correct.