I've got a bunch of strings to browse and find there all words which contains "(at)" characters and then gather them in the array.   Sometimes is a replacement of "@" sign. So let's say my goal would be to find something like this: "account(at)example.com".   I tried this code:   let gathering = myString.match(/(^|\.\s+)((at)[^.]*\.)/g;);   but id does not work. How can I do it?  I found a regex for finding email addresses in text:   /([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi)   I think about something similar but unfortunately I can't just replace @ with (at) here.
591
I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps.  It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps?
38100
I have this regex I built and tested in regex buddy.  "_ [ 0-9]{10}+ {1}+[ 0-9]{10}+ {2}+[ 0-9]{6}+ {2}[ 0-9]{2}"   When I use this in .Net C#   I receive the exception  "parsing \"_ [ 0-9]{10}+ +[ 0-9]{10}+  +[ 0-9]{6}+  [ 0-9]{2}\" - Nested quantifier +."   What does this error mean? Apparently .net doesn't like the expression.  Here is the regex buddy so u can understand my intention with the regex...  _ [ 0-9]{10}+ {1}+[ 0-9]{10}+ {2}+[ 0-9]{6}+ {2}[ 0-9]{2}  Match the characters "_ " literally «_ » Match a single character present in the list below «[ 0-9]{10}+»    Exactly 10 times «{10}+»    The character " " « »    A character in the range between "0" and "9" «0-9» Match the character " " literally « {1}+»    Exactly 1 times «{1}+» Match a single character present in the list below «[ 0-9]{10}+»    Exactly 10 times «{10}+»    The character " " « »    A character in the range between "0" and "9" «0-9» Match the character " " literally « {2}+»    Exactly 2 times «{2}+» Match a single character present in the list below «[ 0-9]{6}+»    Exactly 6 times «{6}+»    The character " " « »    A character in the range between "0" and "9" «0-9» Match the character " " literally « {2}»    Exactly 2 times «{2}» Match a single character present in the list below «[ 0-9]{2}»    Exactly 2 times «{2}»    The character " " « »    A character in the range between "0" and "9" «0-9»   In short...  What is a Nested quantifier?
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.
64488
I am trying to parse url-encoded strings that are made up of key=value pairs separated by either &amp; or &amp;amp;.   The following will only match the first occurrence, breaking apart the keys and values into separate result elements:  var result = mystring.match(/(?:&amp;|&amp;amp;)?([^=]+)=([^&amp;]+)/)   The results for the string '1111342=Adam%20Franco&amp;348572=Bob%20Jones' would be:  ['1111342', 'Adam%20Franco']   Using the global flag, 'g', will match all occurrences, but only return the fully matched sub-strings, not the separated keys and values:  var result = mystring.match(/(?:&amp;|&amp;amp;)?([^=]+)=([^&amp;]+)/g)   The results for the string '1111342=Adam%20Franco&amp;348572=Bob%20Jones' would be:  ['1111342=Adam%20Franco', '&amp;348572=Bob%20Jones']   While I could split the string on &amp; and break apart each key/value pair individually, is there any way using JavaScript's regular expression support to match multiple occurrences of the pattern /(?:&amp;|&amp;amp;)?([^=]+)=([^&amp;]+)/ similar to PHP's preg_match_all() function?  I'm aiming for some way to get results with the sub-matches separated like:  [['1111342', '348572'], ['Adam%20Franco', 'Bob%20Jones']]   or   [['1111342', 'Adam%20Franco'], ['348572', 'Bob%20Jones']]
51462
If I grep a document that contains the following:  ThisExampleString  ...for the expression This*String or *String, nothing is returned. However, This* returns the above line as expected.  Whether the expression is enclosed in quotes makes no difference.  I thought the asterisk indicated any number of unknown characters? Why does it only work if it's at the start of the expression? If this is intended behavior, what do I use instead of the expressions This*String and *String?
6643
I am doing something where I realised I wanted to count how many /s I could find in a string, and then it struck me, that there were several ways to do it, but couldn't decide on what the best (or easiest) was.  At the moment I'm going with something like:  string source = "/once/upon/a/time/"; int count = source.Length - source.Replace("/", "").Length;   But I don't like it at all, any takers?  I don't really want to dig out RegEx for this, do I?  I know my string is going to have the term I'm searching for, so you can assume that...  Of course for strings where length > 1,  string haystack = "/once/upon/a/time"; string needle = "/"; int needleCount = ( haystack.Length - haystack.Replace(needle,"").Length ) / needle.Length;
22511
I want to use input from a user as a regex pattern for a search over some text.  It works, but how I can handle cases where user puts characters that have meaning in regex? For example, the user wants to search for Word (s): regex engine will take the (s) as a group.  I want it to treat it like a string &quot;(s)&quot; .  I can run replace on user input and replace the ( with \( and the ) with \) but the problem is I will need to do replace for every possible regex symbol. Do you know some better way ?
30638
I'm struggling to use String.format to replace a token with a value when the token is within single quotes:  Example:  String query = String.format('SELECT Id FROM Availability WHERE Person__c = \'{0}\'', personId);   String query is equal to:  SELECT Id FROM Availability WHERE Person__c = {0}   Rather than:  SELECT Id FROM Availability WHERE Person__c = '234567890'
95331
How can I replace lone instances of \n with \r\n (LF alone with CRLF) using a regular expression in C#?  Sorry if it's a stupid question, I'm new to Regex.  I know to do it using plan String.Replace, like:  myStr.Replace("\n", "\r\n"); myStr.Replace("\r\r\n", "\r\n");   However, this is inelegant, and would destroy any "\r+\r\n" already in the text (although they are not likely to exist).
3542
I have a value like this:  "Foo Bar" "Another Value" something else   What regex will return the values enclosed in the quotation marks (e.g. Foo Bar and Another Value)?
54715
The title really says it all, but when I use the @ character to ignore escapes in a string literal @"Like This\", the \" is interpreted as a quote character belonging to the string rather than the terminating quote.
37476
What is the easiest way to match non-ASCII characters in a regex? I would like to match all words individually in an input string, but the language may not be English, so I will need to match things like ü, ö, ß, and ñ. Also, this is in Javascript/jQuery, so any solution will need to apply to that.
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"?
64797
Situation: It started out as me  for the literal string C-c in  but it ended up omitting the - sign and showing results which contained the strings C/C++ and C &amp; C++.  is an example of a post which contains that string of characters (yet fails to show up in the results).  Things I've tried:   post suggests that I can use the undocumented code: operator, but when I do that, it just wraps the whole term in double quotes like .  As @terdon in Unix &amp; Linux chat has , using this  does yield some relevant results, but it doesn't show me  that is supposed to be there. edit: It appears that the Symbolhound query no longer returns that result.  Finally,  says that you can search for literal characters, but as you can see:    Quoted phrases are exact matches except for case-sensitivity, for example, you can search  or .  The second example (symbols) leads to 0 results.  So by now I assume that the search engine has changed (but the old documentation still lingers on this site). Is there a method for me to search for strings that include special (or is it literal?) characters?
70124
Using regular expressions, what is the simplest way to fetch a websites HTML and find the value inside this tag (or any attribute's value for that matter):  &lt;html&gt;   &lt;head&gt;   [snip]   &lt;meta name="generator" value="thevalue i'm looking for" /&gt;   [snip]
66745
I'm using the Message module on Drupal 7.  For Replacement tokens, the help text says:     A comma-separated list of replacement tokens, e.g. %title or !url, of   which the message text makes use of. Each replacement token has to   start with one of the special characters "@", "%" or "!". This   character controls the sanitization method used, analogously to the   t() function.   What's the difference between %, !, and @?  Are there standards about when I should use each symbol?
108524
I need a RegEx pattern for extracting all the properties of an image tag.  As we all know, there are lots of malformed HTML out there, so the pattern has to cover those possibilities.  I was looking at this solution  but it didn't quite get it all:  I come up something like:  (alt|title|src|height|width)\s*=\s*["'][\W\w]+?["']   Is there any possibilities I'll be missing or a more efficient simple pattern?  EDIT: Sorry, I will be more specific, I'm doing this using .NET so it's on the server side. I've already a list of img tags, now I just need to parse the properties.