.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

String.Replace With wildcard (and use whatever "wildcard" is)

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :ASP.Net
Hello there,I'm hoping someone out there know a way to accomplish what I'm trying to do, because I'm currently stuck :) What I want to do is to replace lets say ##test## with Something(test)..I know that I can find ##test## by: (Though don't know whether there's a smarter way)System.Text.RegularExpressions.Regex.Replace(str, "##Test.*##", "Output")So basically the problem is to get what the wildcard (.*) is, since thats really what I need to know..Anyone with a brilliant idea how to accomplish this?

View Complete Post

More Related Resource Links

XML Signature xsd and Validation Error: Wildcard '##any' allows element causes the content model t

Hello,I'm trying to generate WCF client from Customer's WCF Service which has XML Signature options enabled.When trying to generate client proxy using svcutil I get following errors: Microsoft (R) Service Model Metadata Tool [Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152] Copyright (c) Microsoft Corporation. All rights reserved. Attempting to download metadata from 'http://donex:51343/WebServices /Service.svc' using WS-Metadata Exchange or DISCO. Error: There was a validation error on a schema generated during export: Source: Line: 1 Column: 13464 Validation Error: Wildcard '##any' allows element 'http://www.w3.org/2000/09/ xmldsig#:HMACOutputLength', and causes the content model to become ambiguous. A content model must be formed such that during validation of an element informati on item sequence, the particle contained directly, indirectly or implicitly ther ein with which to attempt to validate each item in the sequence in turn can be u niquely determined without examining the content or attributes of that item, and without any information about the items in the remainder of the sequence. Error: There was a validation error on a schema generated during export: Source: Line: 1 Column: 14410 Validation Error: Wildcard '##any' allows element 'http://www.w3.org/2000/09/ xmldsig#:XPath', and cau

SQL Server 2008 R2 Express + Wildcard Certificates

Note: Cross-posted from my question at ServerFault: http://serverfault.com/questions/176595/sql-server-2008-r2-express-wildcard-ssl-certificate (Not trying to be a jerk, just think I might get a better response here.) --- Wildcard certificates (for example, *.example.com) simply did not work in SQL Server 2008 or lower. But Encrypting Connections to SQL Server on MSDN states, plain as day, that SQL Server 2008 R2 supports wildcards certificates. Excellent. So I set up SQL Server 2008 R2 Express on a machine, and I configure the HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQLServer\SuperSocketNetLib\Certificate entry to the thumbprint of my wildcard SSL certificate (because in five years of dealing with SQL server, I have never gotten that #$@# dialog in Sql Server Configuration to display any certificates). The SQL Server log then tells me that this went over quite well: 2010-08-31 11:46:04.04 Server The certificate [Cert Hash(sha1) "5DDD9E51B30E0CA6CE3656AE54EC6D0B8B75904A"] was successfully loaded for encryption. Unfortunately, if I attempt to use Microsoft SQL Server Management Studio (the 2008 R2 version) or the Sql* classes provided in the .NET Framework 4.0, I always receive the following exception: A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL

Replace string in xml without converting to varchar using SQL Server

We have a xml datatype in SQL server which gets a xml file loaded into it. We want to replace some of the content in the xml datatype, but are running into problems converting from xml to varchar(for manipulation purposes), back to xml to output. Does anyone know of a way to replace xml without converting to varchar?Thanks in advance

replace empty string with value if it is empty in ssrs

I need to place a "Days Not Calculated" of the string is empty, if it is not empty then a need to use the days calculated and put "days old" on the end of the number....SSRS 2K5 iif (Fields!AGE.Value, "", "Days Not Calculated")& " Days Old "

what does the @ in string.Replace(@"\'","") do?

hi,can anybody please explain me what does the @ character in the function above do?thanks guys

sharepoint wildcard search using SearchDocuments()

Hi, I have to search all the document with name doc in them.So i search it with search parameter as "doc" but it doesnt fetch any result.though i want result as all the document whose name starts with doc. Now I am able to search with fulltext. I want wildcard search using SearchDocuments method. I am using CWeb.SearchDocuments(SearchString). Any Help appricated!!! Thanks Srikanth Reddy

Wildcard Search in SP 2010

Dear Community, with Sharepoint 2010, Microsoft finally added a Wildcard Search. But only a prefixed one, at least as far as I found out. Is there a suffix wildcard search as well and I just didn't find it? If there isn't, can FAST Search do the job? Or do I have to implement a own (extended) search to do this (if even possible)? Thanks in advance, Greetings, SoundofSilence

Wildcard for Guids

Hello all, i have a column with Contacts to use as a Paramter. The display-name is the main and the internal value is of type uniqueidentifier. It should additionally appear a value named 'all' which means that all Contacts should be selected.   I tried it like that:   Select '*' as accountid, '[Alle]' as [name] Union All Select accountid, name from dbo.FilteredAccount order by name   but it gives an error; String cannot be converted to uniqueidentifier.   How can it be solved?   Regards, Patrick

Replace the string after comma starts in MS SQL


Hi All

Could you anybody help me, How to replace the remaining String after the Comma Starts Using SQL Query.  Below is the data

"MediaRights, MediaRightsLink, MediaRightsCompanies, MediaRightsTypes"

EvtBids 1
MediaRights, MediaRightsLink, MediaRightsCompanies, MediaRightsTypes 1
MediaRightsLink 8
SponsorRights, SponsorRightsLink, SponsorRightsBrands, SponsorRightsTypes 3
SponsorRights, SponsorRightsLink, SponsorRightsCompany, SponsorRightsCompanyTypes 1

WildCard Search using document library column


Hi there ,is there any step by step instructions on how to make search using custom columns with wildcard i mean ability to make user fill fields for column like

Registration code [and the user type something]

ItemName[and type another word]

then finally press search

what i have did for now is

created custom columns for document library

created a scope for this specific document library

created managed property mapped to crawled property of these columns

edited properties xml and added propertyDef and PropertyRef

installed DotNetMafia wildcard webpart and activated feature and added this webpart to page.

then no searchbox appeart ,what am i missing?


Replace space from string - REGEX.



I have some problem with RegEx.

I have text:

"something here [tagQuote=Name of Author]bla bla bla[/tagQuote] something here"

And now I want to replace all the whitespace character in quote attribute with "%#%#%#%".

So I want to have: [tagQuote=Name%#%#%#%of%#%#%#%Author]bla bla bla[/tagQuote]

So remove all of the whitespaces between "[tagQuote=" and "]...[/tagQuote]"

ASP.NET MVC2 Custom routing with wildcard or free text url


I have a requirement to add specific functionality to an asp.net mvc2 web site to provide addtional SEO capability, as follows:

The incoming URL is plain text, perhaps a containing a sentence as follows

"http://somesite.com/welcome-to-our-web-site" or "http://somesite.com/cool things/check-out-this-awesome-video"

In the MVC pipeline, I would like to take this URL, strip off the website name, look up the remaining portion in a database table and call an appropriate controller/view based on the content of the data in the table. All controllers will simply take a single parameter bieng the unique id from the lookup table. A different controller may be used depnding on different urls, but this must be derieved from the database.

If the url cannot be resolved a 404 error needs to be provided, if the url is found but obsolete then a 302 redirect needs to be provided.

Where the url is resolved it must be retained in the browser address bar.

I have had a look at the routing model, and custom routing and can't quite work out how to do it using these, as the controller would not be predefined, based on a simple route. I am also unsure of what to do to provide 404, 302 back to the headers also. Perhpas I need a custom httpmodule or similar but going there went beyond my understanding.

This must be possible someho

I need to replace a big string with more than one value



i need to replace a string like change the dataformat, Uppercase,lowercase e.t.c


Ex: I started this question on Sep/29/2010 till i didn't get any REplay.


This has to be change to ...

I Given this question on 29/9/2010 Still i don't got any replay.



How to solve like this type of issue.

Note : this is not my exact requirement, but it matches similar. My String can consists of minimum 500000 words.


Employee Search wildcard- Help with this code


As the default sharepoint search doesn't support wildcard, I used content editor webpart, and insert a code in the source

the code is available at http://www.ramonscott.com/wordpress/ 

It added a text field for First Name, last name and a drop down menu for Dept.

I added an extra text field for telephone ext. The problem that i'm facing is it is searching for exactly what i'm entering in the text field (not the wildcard)

e.g if my ext = 298 --> I should enter 298 to get my name in the result, otherwise the result will return nothing.

How can I change the code to return any record that contain 298 (whether it begins with 298, end with 298, or in the middle)

below is the code from Ramon Scott

<script language="javascript">
//function to handle enter on keyboard
function txtWildPeopleFinder_KeyDown(e)
if (e.keyCode == 13 || e.keyCode==10)
return false;
return true;
//escape apostrophes in search strings
function escapestr(str)
return str.replace("'","%22");

replace tab in the string using regular expression

      I want to replace tab space with "|" in the string using regular expressions.
I have tried for

Dim strTabString AS string = "A             B             C "                 
TextBox1.Text = Regex.Replace(strTabString , "\t", "|")
But i m not getting the results.


Ontolica wildcard search solution exists


From where can i download the free Ontolica wildcard search solution for MOSS 2007?

SSRS - Report Builder - Wildcard usage in a Filter?


I am trying to use a wildcard in a Filter condition within a SSRS - Report Builder report. 


Are wildcards of anytime in fact allowed in this tool?  I get errors when I try to use SQL-like wildcards such as '%'.  I've also been unable to find any mention of "wildcards" in HELP.


Please help as soon as possible.  THANKS!

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend