sql - VB.net regex character syntax -


i can't sql query using regex work in vb.net.

if write

dim localconnection new mysqlconnection = connectionnew(dbname) dim da mysqldataadapter dim ds new dataset dim rows long  sqlstatement= "select `col1` `mytable` `col1` regexp '^[a-z]bc$'"   da = new mysqldataadapter(sqlstatement, localconnection)  rows = da.fill(ds) 

it returns null, though there cell containing "abc". when run directly on database, returns row correctly.

if remove [a-z], works fine in both circumstances.

is possible "binary strings" involved?

from: http://dev.mysql.com/doc/refman/5.1/en/regexp.html

regexp not case sensitive, except when used binary strings.

it makes warnings multi-byte characters.

the regexp , rlike operators work in byte-wise fashion, not multi-byte safe , may produce unexpected results multi-byte character sets. in addition, these operators compare characters byte values , accented characters may not compare equal if given collation treats them equal.

since vb.net works in unicode, possible sort of character-set or code-page mangling may happening behind scenes?


Comments

Popular posts from this blog

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -

Java - Returning an array from a method to main -