I have a TextFormField for a phone number and I  want to validate the input to match my RegEx to phone number value  the valid inputs are   075xxxxxxxx 077xxxxxxxx 078xxxxxxxx 079xxxxxxxx   I tried this r"^ (?:[0]7)?[0-9]{11}$" but its not working  any way to do it right?
2898
I'm trying to put together a comprehensive regex to validate phone numbers. Ideally it would handle international formats, but it must handle US formats, including the following:   1-234-567-8901 1-234-567-8901 x1234 1-234-567-8901 ext1234 1 (234) 567-8901 1.234.567.8901 1/234/567/8901 12345678901   I'll answer with my current attempt, but I'm hoping somebody has something better and/or more elegant.
94801
I have the following C# which simply replaces parts of the input string that look like EQUIP:19d005 into URLs, like this:  input = Regex.Replace(input, @"(EQUIP:)(\S+)", @"&lt;a title=""View equipment item $2"" href=""/EquipmentDisplay.asp?eqnum=$2""&gt;$1$2&lt;/a&gt;", RegexOptions.IgnoreCase);   The HTML ends up looking like this.  &lt;a title="View equipment item 19d005" href="/EquipmentDisplay.asp?eqnum=19d005"&gt;EQUIP:19d005&lt;/a&gt;   The only trouble is that the destination page expects the eqnum querystring to be all UPPERCASE so it returns the correct equipment when eqnum=19D005 but fails if it receives eqnum=19d005.  I guess I can modify and correct EquipmentDisplay.asp's errant requirement of uppercase values however, if possible I'd like to make the C# code comply with the existing classic ASP page by uppercasing the $2 in the Regex.Replace statement above.  Ideally, I'd like the HTML returned to look like this:  &lt;a title="View equipment item 19d005" href="/EquipmentDisplay.asp?eqnum=19D005"&gt;EQUIP:19d005&lt;/a&gt;   Notice although the original string was EQUIP:19d005 (lowercase), only the eqnum= value is uppercased.  Can it be done and if so, what's the tidiest way to do it?
85921
I am wondering if it is possible to dynamically format input numbers in Visualforce components when rendering as HTML. I am able to successfully accomplish this when rendering as output tags doing the following:  &lt;apex:outputText value="{0, number, ###,##0}"&gt;     &lt;apex:param value="{!myNumber}"/&gt; &lt;/apex:outputText&gt;   Which yields a value of 123,456 provided myNumber is an Integer of 123456. In an ideal world, this would work in inputText as well (and there are ways to accomplish this via javascript), but I am curious if there is anything "out of the box" with Salesforce.  UPDATE: Modified original question after noticing a syntax error.
58099
I would like to have a regular expression that checks if a string contains only upper and lowercase letters, numbers, and underscores.
81981
In python   re.sub(r"(?&lt;=.)(?=(?:...)+$)", ",", stroke )    To split a number by triplets, e.g.:   echo 123456789 | python -c 'import sys;import re; print re.sub(r"(?&lt;=.)(?=(?:...)+$)", ",",  sys.stdin.read());'  123,456,789   How to do the same with bash/awk?
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)
835
Over the years I have slowly developed a  that validates MOST email addresses correctly, assuming they don't use an IP address as the server part.  I use it in several PHP programs, and it works most of the time.  However, from time to time I get contacted by someone that is having trouble with a site that uses it, and I end up having to make some adjustment (most recently I realized that I wasn't allowing 4-character TLDs).  What is the best regular expression you have or have seen for validating emails?  I've seen several solutions that use functions that use several shorter expressions, but I'd rather have one long complex expression in a simple function instead of several short expression in a more complex function.
10136
How can I validate the user input by using scanf. Right now I have something like this, but doesn't work.  NOTE: I have the atoi just to validate that the scanf validation works.  scanf("%[0987654321.-]s",buf);  i = atoi(buf);  if(i)     index = i;
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 ?
89647
How should required field validation be handled visually?  Note: assume asterisk is red  *Name:[_______________]   or  Name:*[_______________]   or  Name: [_______________]*   or  Name: [____red bg____  ]  or  Name(&lt;- font color red): [_______________]  or  You tell me a better way!
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.
95301
I have a shapefile of data for Japan, and I need to extract the English character names in my "name" field in order to label the layer. Much of the data is all in Japanese, but some of the names have an alternate English name which can be found inside a set of parenthesis. I'd like to extract this text to another field and use it for labeling. I'm using QGIS.  Example:  I need to turn  野川サイクリング道路 (Nogawa Cycling Road)     Into   Nogawa Cycling Road   I'm attempting to use the regexp_substr function in the Field Calculator:  regexp_substr( "name", '\((.*?)\)')   When I try to run this, I get an error:      An error occured while evaluating the calculation string: Invalid regular expression '?(.*?)?': bad repetition syntax.   Oddly, in testing, I tried this same regex in PostGIS and it worked great. Does anyone know of a regex that will do this task in the QGIS field calculator?
2940
How can I test if a RegEx matches a string exactly?  var r = /a/; r.test("a"); // returns true r.test("ba"); // returns true testExact(r, "ba"); // should return false testExact(r, "a"); // should return true
47779
Im a newbie in Apex and im developing a page using Visualforce.  My string format is always like this "xx-xx-999999". In this format I need to get only the integer. For example the string is  "RO-W1-445567". I want to get only the integer 445567 in the string. Can someone willing to share a piece of apex code in my problem.  Your help is vey much appreciated.  Thanks in advance!  Ferdie Banu
54661
How do I extract a double value from a string using regex.  import re  pattr = re.compile(???)     x = pattr.match("4.5")
5821
I need a Perl regular expression to match a string. I'm assuming only double-quoted strings, that a \" is a literal quote character and NOT the end of the string, and that a \ is a literal backslash character and should not escape a quote character. If it's not clear, some examples:  "\""    # string is 1 character long, contains dobule quote "\\"    # string is 1 character long, contains backslash "\\\""  # string is 2 characters long, contains backslash and double quote "\\\\"  # string is 2 characters long, contains two backslashes   I need a regular expression that can recognize all 4 of these possibilities, and all other simple variations on those possibilities, as valid strings. What I have now is:  /".*[^\\]"/   But that's not right - it won't match any of those except the first one. Can anyone give me a push in the right direction on how to handle this?
99736
I'm searching for UUIDs in blocks of text using a regex. Currently I'm relying on the assumption that all UUIDs will follow a patttern of 8-4-4-4-12 hexadecimal digits.  Can anyone think of a use case where this assumption would be invalid and would cause me to miss some UUIDs?