Hi Can anyone tell me the regex for the below condition.  "" or "" is valid. this should not allow any spaces before "http" , "https" and after "ef". There can be any text after "ef". but the validation should not match in the below case.  " k" --> since space is present between j and k-> validation should fail  "  "-> since space is present in starting or trail -> validation should fail.    simply to put  [No spaces allowed][https:// or  text or symbol].[any text or symbol for 2 words][optional text without no spaces in start or between or ending ]
6007
How can I check if a given string is a valid URL address?  My knowledge of regular expressions is basic and doesn't allow me to choose from the hundreds of regular expressions I've already seen on the web.
54907
In written English (mainly online) I often come across sentences ending with a question or an exclamation mark with a space before it. Is it always just an error or a typo? Or there are cases when it is a correct English, for example after closing parentheses or some other punctuation marks?
20352
Is it possible to detect a valid regular expression with another regular expression?  If so please give example code below.
92922
I'm having trouble writing a regular expression that matches valid IPv6 addresses, including those in their compressed form (with :: or leading zeros omitted from each byte pair).    Can someone suggest a regular expression that would fulfill the requirement?  I'm considering expanding each byte pair and matching the result with a simpler regex.
111512
I am using this method to try find a match, in an example:  Regex.Match("A2-TS-OIL", "TS-OIL", RegexOptions.IgnoreCase).Success;   I got a true result. I am confused. I think this should return false since there is no special characters in the pattern. If I use ".+TS-OIL", true should be returned (. for any and + for more than 1). How should I do to get what I need?
17027
I'm trying to write a regular expression that validates a date.  The regex needs to match the following   M/D/YYYY MM/DD/YYYY Single digit months can start with a leading zero (eg: 03/12/2008) Single digit days can start with a leading zero (eg: 3/02/2008) CANNOT include February 30 or February 31 (eg: 2/31/2008)   So far I have   ^(([1-9]|1[012])[-/.]([1-9]|[12][0-9]|3[01])[-/.](19|20)\d\d)|((1[012]|0[1-9])(3[01]|2\d|1\d|0[1-9])(19|20)\d\d)|((1[012]|0[1-9])[-/.](3[01]|2\d|1\d|0[1-9])[-/.](19|20)\d\d)$   This matches properly EXCEPT it still includes 2/30/2008 &amp; 2/31/2008.  Does anyone have a better suggestion?  Edit: I found  on RegExLib  ^((((0[13578])|([13578])|(1[02]))[\/](([1-9])|([0-2][0-9])|(3[01])))|(((0[469])|([469])|(11))[\/](([1-9])|([0-2][0-9])|(30)))|((2|02)[\/](([1-9])|([0-2][0-9]))))[\/]\d{4}$|^\d{4}$   It matches all valid months that follow the MM/DD/YYYY format.  Thanks everyone for the help.
33382
Can a regular expression match whitespace or the start of a string?  I'm trying to replace currency the abbreviation GBP with a £ symbol. I could just match anything starting GBP, but I'd like to be a bit more conservative, and look for certain delimiters around it.  &gt;&gt;&gt; import re &gt;&gt;&gt; text = u'GBP 5 Off when you spend GBP75.00'  &gt;&gt;&gt; re.sub(ur'GBP([\W\d])', ur'£\g&lt;1&gt;', text) # matches GBP with any prefix u'\xa3 5 Off when you spend \xa375.00'  &gt;&gt;&gt; re.sub(ur'^GBP([\W\d])', ur'£\g&lt;1&gt;', text) # matches at start only u'\xa3 5 Off when you spend GBP75.00'  &gt;&gt;&gt; re.sub(ur'(\W)GBP([\W\d])', ur'\g&lt;1&gt;£\g&lt;2&gt;', text) # matches whitespace prefix only u'GBP 5 Off when you spend \xa375.00'   Can I do both of the latter examples at the same time?
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" }
123924
I'm trying to match a string pattern to any string in an array:  SELECT 'abc' LIKE ANY('{"abc","def"}') -- TRUE  -- BUT  SELECT 'ab%' LIKE ANY('{"abc","def"}') -- FALSE, I expect TRUE   What is wrong with the second query?
79970
I would like to use the .Net Regex.Split method to split this input string into an array. It must split on whitespace unless it is enclosed in a quote.  Input:  Here is "my string"&nbsp;&nbsp;&nbsp;&nbsp;it has "six&nbsp;&nbsp;matches"  Expected output:   Here is my string it has six&nbsp;&nbsp;matches   What pattern do I need? Also do I need to specify any RegexOptions?
85789
I'm trying to use this code to replace spaces with _, it works for the first space in the string but all the other instances of spaces remain unchanged. Anybody know why?  function updateKey() {     var key=$("#title").val();     key=key.replace(" ","_");     $("#url_key").val(key); }
112080
I'm looking for the ultimate postal code and zip code regex. I'm looking for something that will cover most (hopefully all) of the world.
57802
I have a regex created from a list in a database to match names for types of buildings in a game. The problem is typos, sometimes those writing instructions for their team in the game will misspell a building name and obviously the regex will then not pick it up (i.e. spelling "University" and "Unversity").  Are there any suggestions on making a regex match misspellings of 1 or 2 letters?  The regex is dynamically generated and run on a local machine that's able to handle a lot more load so I have as a last resort to algorithmically create versions of each word with a letter missing and then another with letters added in.  I'm using PHP but I'd hope that any solution to this issue would not be PHP specific.
42865
Can anyone help me with this question: I know it before, but I have tried to solve it myself and didnt succeed. what is the regular expression for this language: L=all words that have 00 or 11 but not both.  Thank you!
111242
I have a , and I'm trying to match it to a regular expression to pull out some groups. The problem I'm having is that the URL can either end or continue with a "/" and more URL text. I'd like to match URLs like this:        But not match something like this:      So, I thought my best bet was something like this:    /(.+)/(\d{4}-\d{2}-\d{2})-(\d+)[/$]   where the character class at the end contained either the "/" or the end-of-line. The character class doesn't seem to be happy with the "$" in there though. How can I best discriminate between these URLs while still pulling back the correct groups?
114698
I ask this because Firefox suggested that whitespaces is not a valid word; rather it gave me whitespace or white spaces.
35886
Code is supposed to be exact and "as-is". Sometimes, showing two spaces is important. In a comment, it is not possible to show code with  multiple   spaces. This became apparent in  (see comments).  EDIT: apparently this bug is larger then I thought: multiple    spaces   here are neither preserved in normal question text. Pity (though I couldn't find this reported before, I'd assume it is).  Workaround: use Alt+0160 (windows), or U+00A0 (Unicode NBSP), as I did in the example above.