I am trying to build my regex to validate phone numbers. These are the rules:   Telephones should not contain any characters except numbers and +  Other strings which doesn't start with 06 or +316 or 0316 or 00316 are invalid.   This is what I tried: $telephone = preg_replace('/[^0-9+]/','', $telephone);  removes all characters except + and numbers . Here still I need to check if the + is the first character or not. For example 466116+ or 21323+3122 are invalid.  preg_match('/^(06|+316)/i', $telephone) . I am trying here to add the starting conditions , but it doesn't work . Could you please help me out?  I am lost with regex :| Thank you
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.
Who is this running kid wearing a shirt with Uchiha symbol? There's a kid wearing a shirt with Uchiha symbol, but I have no idea who s/he is.    Who is this kid? This question led to a new package:      I want to reference to citations from other file. Similar to what xr package does to labels, but I want to apply it for the bibliography.  If I'm able to do \cite{someone} in the main file, and it creates let say the number [4], I want to do the same \cite{someone} in a second file, and also create the same number [4]. Similar to what xr does with the labels.  By the way, I tried to add the main.bbl file from the main file. However, that adds all the references to the end of the second file. I want to avoid this.  Is there any package that accomplish this? Let's say I have some data, and then I fit the data with a model (a non-linear regression). Then I calculate the R-squared ($R^2$).  When R-squared is negative, what does that mean? Does that mean my model is bad? I know the range of $R^2$ can be [-1,1]. When $R^2$ is 0, what does that mean as well? Is it safe to travel to Miami Beach shortly after hurricane Irma? Two months ago my girl and I booked our vacation. We are from Berlin, Germany and wanted to see the U.S. Our first stop is Miami Beach at the 15th and we want to stay there for 3 days and continue to NYC. Later on we will go to Vegas and come back to Miami the 26th of September and stay there another 4 nights.  I expect the hurricane will be gone by the 15th, but I have no idea whether it will be okay. For me okay means that we can reach our hotel and sleep there.  What do you suggest? I know this question is primarily opinion based, but here in Germany we don't have hurricanes and I don't know how fast the state will recover. PDF of a sum of exponential random variables Let $X_i$ for $i=1,2,...$ be a sequence of i.i.d exponential random variables with common parameter $\lambda$. Let $N$ be a geometric random variable with parameter $p$ that is independent of the sequence $X_i$. What is the pdf of the random variable $Y=\Sigma_{i=1}^N X_i$. Dual boot. How do I reinstall the Ubuntu partition? Use worksheet name as a variable in a lookup I have 2 workbooks with 60 plus worksheets. I need to copy data from one workbook to the other but would like to capture and use the worksheet name within the cell. This is because when I create the workbook I make a master worksheet and then copy it 60 plus times. The above would make the cell ref for each worksheet the corresponding worksheet cell in the other file. Can I prepay a Credit Card to make a Large Purchase greater than my credit limit? I want to make a large purchase at a retail store to the sum of $10,000 but the credit limit on my card is set at $2000.  If I send $10K to my credit card will the purchase be allowed to go through?  Not sure if the credit limit is a hard limit or not?  I don't want to be left embarrassed if my card is declined in the store lol.  I called my bank but the answer they gave wasn't too convincing. It was kind of "Errr yes i think its OK!"  Does any one know first hand? By default  indents with a hard tab character. How do I change it to spaces? Evaluation of OptionValue[] Is there any software package to solve the linear regression with the objective of minimizing the L-infinity norm. How do I run a 'sudo' command inside a script? How can we connect a PHP script to MS Access (.mdb) file?  I tried by including following PHP code:  $db_path = $_SERVER['DOCUMENT_ROOT'] . '\WebUpdate\\' . $file_name . '.mdb'; $cfg_dsn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" . $db_path; $odbcconnect = odbc_connect($cfg_dsn, '', '');   But it failed and I received following error message:   Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in C:\web\WebUpdate\index.php on line 41 How to disable captive portal detection? How to remove exclamation mark on Wi-Fi or signal icon in Lollipop? When connected to the Internet, the system checks if it's in a walled garden, which is simply trying to connect to Google. If it fails, in Android 5, there'll be an exclamation mark on the WiFi icon or signal icon.   In some situations, this is annoying. Say, in China, Google is blocked, the exclamation mark will always be there, which is meaningless.  How can I disable this check, and make the system assume, connected WiFi/mobile data is connected Internet? The  from Goblin Punch states the following:     Hungry Coffin   HD 6 AC 14 Slam 2d6 or 2d8 Swallow 1d6 + swallow   Fly 9 Int 5 Morale 12   It says the Hungry Coffin has "HD 6". This doesn't help me at all, because I still don't know what its average HP is, or how to roll its HP. How do I figure this out? Thanks! How to select multiple files with keyboard only in windows explorer InDesign: How to restore text-frame position/size to be managed by the master page instead of the actual page? I have some designer that moved slightly a text-frame and in order to be managed again by the master page we need to remove the page and create a new one inserting the content in it.  Is there any different way to do it?  I would like to be able to restore the "power" of positioning/size to the master page because now we need to change the master-page to position the text-frame a little bit to the right and in the case above mentioned will not be updated.  Thanks Should I vote to close a duplicate question, even though it's much newer, and has more up to date answers? If $a^2$ divides $b^2$, then $a$ divides $b$ Full file date (without GNU utilities) I am trying to obtain the full date (created or modified) of a particular file for passing to another program. I have tried variations of options with the ls command but none provide a full date for files less than 6 months old and I have limit usage of the options. When I try certain options I have seen trying to research this I get the following message:  usage: ls [-1ACFHLNRabcdefgilmnopqrstuxEUX] [File...]   None of which seems to provide what I needs as far as I can tell so I tried to use the stat command but it is not available to me.  I am using the Korn shell on AIX 5.3 which has limited commands available, can anyone suggest another way that I might be able to obtain a file's created or modified date as a full date (either dd/mm/yyyy or yyyy/mm/dd).