In regex, what does [\w*] mean?

Quick answer: ^[\w*]$ will match a string consisting of a single character, where that character is alphanumeric (letters, numbers) an underscore (_) or an asterisk (*). Details: The “\w” means “any word character” which usually means alphanumeric (letters, numbers, regardless of case) plus underscore (_) The “^” “anchors” to the beginning of a string, and … Read more

How can I check the SQL syntax in a .sql file?

SELECT STATEMENT_DIGEST_TEXT in MySQL 8.0 can be used for MySQL query syntax validation. 8.0.4>SELECT STATEMENT_DIGEST_TEXT(‘FLUSH TABLES’)\G STATEMENT_DIGEST_TEXT(‘FLUSH TABLES’): FLUSH TABLES 8.0.4>SELECT STATEMENT_DIGEST_TEXT(“SET GLOBAL second_cache.key_buffer_size=128*1024;”)\G STATEMENT_DIGEST_TEXT(“SET GLOBAL second_cache.key_buffer_size=128*1024;”): SET GLOBAL `second_cache` . `key_buffer_size` = ? * ? ; 8.0.4>SELECT STATEMENT_DIGEST_TEXT(“create TABLE t1 ( a2 int unsigned not null, b2 int unsigned not null, c2 int unsigned … Read more

Why does a collection initializer expression require IEnumerable to be implemented?

An object initializer doesn’t; a collection initializer does. It’s so that it’s applied to classes which really represent collections, rather than just arbitrary ones which have an Add method. I have to admit that every so often I’ve “implemented” IEnumerable explicitly, just to allow collection initializers – but thrown a NotImplementedException from GetEnumerator(). Note that … Read more

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