Solved

DataView: Using Regular Expression in RowFilter

Posted on 2008-06-13
1
1,977 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Creating and Managing Databases with phpMyAdmin in cPanel.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

728 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