Solved

DataView: Using Regular Expression in RowFilter

Posted on 2008-06-13
1
1,930 Views
Last Modified: 2008-06-15
I am trying to figure out how to use a regular expression in a dataview's RowFilter. In PHP, it looks like this:
`field` REGEXP '[[:<:]]word[[:>:]]', which will find instances in the MySQL table where "word" has a word boundary on it. This is what I tried in vb.Net:
dv.RowFilter = "[field] REGEXP '\bword\b'" and I also tried dv.RowFilter = "[field] REGEXP '[[:<:]]word[[:>:]]'". Both of these return this error:
Syntax error: Missing operand after 'REGEXP' operator. Can someone tell me what I am doing wrong? Thanks.
0
Comment
Question by:rbichon
1 Comment
 
LVL 63

Accepted Solution

by:
Fernando Soto earned 500 total points
ID: 21782785
Hi rbichon;

You can't execute a regular expression with in the RowFilter property of the DataView. The RowFilter property gets or sets the expression used to filter which rows are viewed in the DataView. The expression can be built using the tokens from the following documentation.

http://msdn.microsoft.com/en-us/library/system.data.datacolumn.expression.aspx

Look starting at the remarks section.

Fernando
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question