Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6045719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:09:22+00:00 2026-05-23T07:09:22+00:00

Does any one have a handy ready to use method to escape wildcards, invalid

  • 0

Does any one have a handy ready to use method to escape wildcards, invalid characters in the string to be assigned to RowFilter for a DataView in C#. The rules somewhat are like below

If a column name contains any of these special characters ~ ( ) # \ / = > < + - * % & | ^ ' " 

[ ], you must enclose the column name within square brackets [ ]. If a column name contains 

right bracket ] or backslash \, escape it with backslash (\] or \\).

thanks 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:09:23+00:00Added an answer on May 23, 2026 at 7:09 am

    This will work based on the specs outlined in a bit more detail found here

    protected void Page_Load(object sender, EventArgs e)
    {
        CheckValue("fefe[][]12#");
        CheckValue("abvds");
        CheckValue("#");
        CheckValue(@"[][][][][]\\\\\][]");
        CheckValue("^^^efewfew[[]");
    }
    
    public static string CheckValue(string value)
    {
        StringBuilder sBuilder = new StringBuilder(value);
    
        string pattern = @"([-\]\[<>\?\*\\\""/\|\~\(\)\#/=><+\%&\^\'])";
    
        Regex expression = new Regex(pattern);
    
        if (expression.IsMatch(value))
        {
            sBuilder.Replace(@"\", @"\\");
            sBuilder.Replace("]", @"\]");
            sBuilder.Insert(0, "[");
            sBuilder.Append("]");
        }
        return sBuilder.ToString();
    }
    

    I tossed it into a web page I was looking at so disregard the Page_Load and of course test however you would like.

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does any one have any idea why this would be happening? This is some
Does any one have tried to customize default section index displayed in UITableView. I
IS this straightforward? Does any one have any good examples? All my google searches
Does any one know how I would have to change the following to work
Does anyone have a regular expression handy that will match any legal DNS hostname
Does ** have any special meaning in C? Like this: static intparse_one (int argc,
Does anyone have any examples on how to integrate a task scheduler in Bottle.
Quick one; am I right in thinking that passing a string to a method
Does anyone have a translate function for x/y positions after rotation in javascript? for
Does anyone have recommendations on the best Online Store for non-technical users of Joomla?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.