Regular Expression for alphanumeric and underscores

To match a string that contains only those characters (or an empty string), try This works for .NET regular expressions, and probably a lot of other languages as well. Breaking it down: If you don’t want to allow empty strings, use + instead of *. As others have pointed out, some regex languages have a shorthand form … Read more

Regex: ignore case sensitivity

Assuming you want the whole regex to ignore case, you should look for the i flag. Nearly all regex engines support it: Check the documentation for your language/platform/tool to find how the matching modes are specified. If you want only part of the regex to be case insensitive (as my original answer presumed), then you … Read more

whitespace in regular expression

\t is not equivalent to \s+, but \s+ should match a tab (\t). The problem in your example is that the second pattern \s\s+ is looking for two or more whitespace characters, and \t is only one whitespace character. Here are some examples that should help you understand: \s\s+ would also match ‘ \t’, ‘\n\t’, ‘ \n \t \t\n’. Also, \s\s* is equivalent to \s+. Both will match one or more whitespace … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)