I want to match any character after some word (limit is an example).  ✔ nnn : am -limitaaaa ça UNICODE HERE sdasdsadaw ✔ UNICODE HERE limitaaaa,.@#!~`%$&amp;*()[]{}|\+=-_?/'":;.&gt;&lt;, 777723xx sss fff s :,   my current regex.   /limit+([.*\s\w\d\p{M}\p{L}\p{S},:@#!~`%$&amp;()\[\]\{\}\|\\+=\-_\?\/\'";&gt;&lt;]+)/   My regex works, but it looks too long. My question is can I make it shorter?  Note: If you need to know what kind of language that I used, I using PHP for this.
4355
For example, this regex  (.*)&lt;FooBar&gt;   will match:  abcde&lt;FooBar&gt;   But how do I get it to match across multiple lines?  abcde fghij&lt;FooBar&gt;
12909
I'm using RegexBuddy but I'm in trouble anyway with this thing :\  I'm processing line by line a file. I built a "line model" to match what I want.  Now i'd like to do an inverse match... i.e. I want to match lines where there is a string of 6 letters, but only if these six letters are not Andrea, how should I do that?    EDIT: I'll write the program that uses this regex, I don't know yet if in python or php, I'm doing this thing first to learn some regex :) There are different types of line, I wanted to use regex to select the type i'm interested in. Once I got these lines I've to apply an other filter just to do not match a known value, I need all the others, not that. The (?!not-wanted) is working pretty fine, thank you. :-)  I hope this clarifies the question :)
3154
I have a string User name (sales) and I want to extract the text between the brackets, how would I do this?   I suspect sub-string but I can't work out how to read until the closing bracket, the length of text will vary.
2660
I need to find a reg ex that only allows alphanumeric. So far, everyone I try only works if the string is alphanumeric, meaning contains both a letter and a number. I just want one what would allow either and not require both.
70098
I'm trying to get a regex that will match:  somefile_1.txt somefile_2.txt somefile_{anything}.txt   but not match:  somefile_16.txt   I tried  somefile_[^(16)].txt   with no luck (it includes even the "16" record)
68712
I am working on a text written in Italian and Chinese and I need to extract only Chinese characters using AWK. How can I do this?  I tried:  [The range of Chinese Unicode chars is 4E00 thru 9FFF (344 270 200 thru 351 277 277) so the test should be &gt;"\343" and &lt;"\352" (to avoid picking up any 4 char UTF-8 codes)]:  { f=0; for ( i=1; i&lt;=length; i++) if(substr($0, i, 1)&gt;"\343" &amp;&amp;substr($0, i, 1)&lt;"\352") f = 1   print $f }   But there is an error or more errors. I can't find it / them
118631
A friend asked me this and I was stumped: Is there a way to craft a regular expression that matches a sequence of the same character? E.g.,  match on 'aaa', 'bbb', but not 'abc'?  m|\w{2,3}|    Wouldn't do the trick as it would match 'abc'.  m|a{2,3}|    Wouldn't do the trick as it wouldn't match 'bbb', 'ccc', etc.
65617
I know that Regular expressions are to be used only with characters and strings, but sometimes I find them in the names of files. My question is: are regexes only used with characters or also with filenames?
6470
I have code in functions.php:  function string_limit_words($string, $word_limit) {   $words = explode(' ', $string, ($word_limit + 1));   if(count($words) &gt; $word_limit)   array_pop($words);   return implode(' ', $words); }   but i need to limit excerpt in number of characters, could you help me with that?
84698
I'm looking to write a script that will find and replace any characters other than [^A-Za-z0-9._-] in a specific file type (in this case .avi) with an underscore _. I want this to exec recursively from the current path. I'm using Ubuntu.  I do not want or need to change any folder names as I have control over those at the time of creation. Here's what I have now after referencing the following link:    find . -depth -exec rename 's!([^/]*\Z)/[^A-Za-z0-9._-]/_/g' *.avi {} +   I'm clearly missing something. Please help. :)
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}?
8877
I've seen lots of examples of making an entire regular expression case-insensitive.  What I'm wondering about is having just part of the expression be case-insensitive.  For example, let's say I have a string like this:  fooFOOfOoFoOBARBARbarbarbAr   What if I want to match all occurrences of "foo" regardless of case but I only want to match the upper-case "BAR"s?  The ideal solution would be something that works across regex flavors but I'm interested in hearing language-specific ones as well (Thanks )  Edit  The link Espo provided was very helpful.  There's a good example in there about turning modifiers on and off within the expression.  For my contrived example, I can do something like this:  (?i)foo*(?-i)|BAR   which makes the match case-insensitive for just the foo portion of the match.  That seemed to work in most regex implementations except Javascript, Python, and a few others (as Espo mentioned).    The big ones that I was wondering about (Perl, PHP, .NET) all support inline mode changes.
67727
How can I get the value between quotes with an RegEx  for example I want to find all the parameters from the function test  &lt;html&gt;    test("bla");    print("foo");    test("moo"); &lt;/html&gt;   The result must be { "bla", "moo" }
121078
The following MWE yields the attached picture:  \documentclass{article}  \usepackage{fontspec} \usepackage{amsmath,amssymb} \usepackage{unicode-math}  \begin{document} With \LaTeX{} commands: \begin{gather*}   A \not= B\\   A \not\le B\\   A \not\lesssim B\\   A \not\approxeq B \end{gather*}  With Unicode characters:  \begin{gather*}   A \not= B\\   A \not≤ B\\   A \not≲ B\\   A \not≊ B \end{gather*} \end{document}     Why is \not replaced by 6?  I tried using a Unicode combining long solidus overlay instead, but that doesn't work at all:  \begin{gather*}   A ≠ B\\   A ≰ B\\   A ≴ B\\   A ≊̸ B \end{gather*}
14665
I've been looking for a simple regex for URLs, does anybody have one handy that works well?  I didn't find one with the zend framework validation classes and have seen several implementations.
32741
The  states that:     Since 1.0.4, case insensitive regular expressions can be used by prefixing the pattern with ~*.   And gives the example:  map $uri $myvalue {     /aa                   /mapped_aa;     ~^/aa/(?&lt;suffix&gt;.*)$  $suffix; }   I updated to nginx/1.2.7 to make use of this, and naive regexes work okay, but variables don't. When I try the above syntax I get the error:  nginx: [emerg] pcre_compile() failed: unrecognized character after (?&lt; in "^/aa/(?&lt;suffix&gt;.*)$" at "suffix&gt;.*)$"   I also tried the following syntaxes, but none of them worked:  ~^(.*)$  $1; ~^(.*)$  \1;   but neither of them worked either.  Does anyone know how to get variables to work in regular expressions in HttpMapModule?
37242
Is it possible to do a multiline pattern match using sed, awk or grep? Take for example, I would like to get all the lines between { and }  So it should be able to match    1. {}  2. {.....}  3. {.....      .....}  Initially the question used &lt;p&gt; as an example. Edited the question to use { and}.