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

Top 5 Contributors of the Month
Sandeep Singh
Post New Web Links

how to find multiline string literals (@"bla") in .cs files (C# sourses)

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :.NET Framework
Hello, My app searches a key word over .CS file (C# sourse) and I want to exlude all string literals because of possability of appearance of key word within this string which is unwanted. I've already composed a regex for common strings - like this - string s = "bla \"bla\" bla" ; This is highlighted correctly by ((?<!(\\|@))".*?"(?<!\\")) But I can't fix up the case with multiline strings. For instance - string s = @"bla ""bla"" bla" ; or string s = @" bla ""bla"" bla" ; In such type of strings there is a rule - within strings can be quotes but only if they are doubled. These are correct examples - @"bla """"""""bla """""" bla" @""" bla """"bla bla" @""""" bla"" bla bla""" These are incorrect - @"" bla "" bla bla"" @"bla """ bla bla" I have some clues - I know how to catch even quantity of quotes - by this regex - ((?<!")("")*(?!")) how to catch odd quantity - ((?<!")"("")*(?!")) how to catch strings which have even quantity of quotes, ex

View Complete Post

More Related Resource Links

How to create a "search function" to find files and folders using C++ windows forms?

As mentioned above, how can I make a windows forms application that searches for files and folders specified by the user and display results in a ListBox? Thanks in advance another question: How can I make a textbox transparent? I would be really grateful if anybody told me what books are good to learn windows forms using C++? thanks again

Find first word in string??

Hey I would like to ask does anyone know how I can find the first word in a  stringif my String = apple; cat; dog; horse  I would like to get the first word ... appleThank you for taking the time to help meI really appreciate this :)RegardsJake

"designer" problem- can't find the files

i got a project (.NET website) from another developer, unlike my project, every page has three parts- the aspx page, the cs page and a "designer" page. i tried to run the web site but i get error problem- "could not load .... type", it looks like the builder can't connect the designer file to the right page. how can i solve the problem can i link the page and the designer...

Where exactly can I find my files that I used in groove / sharepoint?

My machine software is more or less trashed. All data is still there and I need to format before installing again. I used to keep files in my own sharepoint (grovve) folders, they were not shared with anyone anywhere. I've seen a couple of queries where it says click on workspaces under favourites - not there. I have a copy of my entire drive under my username, so anything that was there is still there. Can anyone tell me where my files are? I'm on WIndows 7 with office 2010 Many thanks

find a string beetwen tag


hi guys

i have a string contain :

kasjbdfkjasbdf klsajdfl

ajbfk  <html> ... </html> ksadfksadfwie...

now i wnat to find string beetwen <html> tag

(with regex)

how i can do that?

tnx guys

find files older than 15 minutes


Can someone please provide me with an example in vb.net of how I can delete a files that was created more than 15 minutes ago? I've been looking on google but can't really find a clear example.I think I need to use FileSystemInfo.CreationTime but not sure..If someone

could get me started I'd appreciate it ...Thank You 

Pass index number and find the char in a string?


How do i find the charactors in teh first index and the last index number of a string? 


Visual Studio 2005 can't find my files in subfolders, why?!


I am having a heck of a time with this.  Visual Studio 2005 SP1 can not find my files and javascript files whenever I put it in the subfolders.  In the solution explorer, I've created subolfders such as /js and /css.  This is inside my main folder:  AJAXEnabledWebApplication1\css  and AJAXEnabledWebApplication1\js

In HTML code, when I put this: <script type="text/javascript" src="js/jquery-1.4.2.js"></script>
    <script type="text/javascript" src="ui/jquery.ui.core.js"></script>
    <script type="text/javascript" src="ui/jquery.ui.widget.js"></script>
    <script type="text/javascript" src="ui/jquery.ui.mouse.js"></script>
    <script type="text/javascript" src="ui/jquery.ui.selectable.js"></script>

every single one of them is highlighted that it can not find the specified file.  But wait, if I add those files manually to the root folder and to the solution explorer, it is no problem!!?? why?!?

why is this happening?

inside the reference paths for the program, I've also pointed to the root folder location:

c:\document adn settings\myname\my Docum

How to use Regular Expression to find a particular pattern and its index in the string??



I need some help here. I have a document containing some string like the following:


Now what I need is that I need to extract this "BusinessGoal" which as you can see, is 32 characters ahead after "-" (hyphen) and change it's case to uppercase.

The real challange is that, This "BusinessGoal" should only be replaced only and only where there is "Ref-<any 32 characters>" before it and not all. So if I find something like TypeName = "BusinessGoal"  it will be simply ignored.

So how am I going to make that reg Ex. I think it would be a combination of Regex and String Api. 

Kindly help me out.

Thanks and regards



Fahad Ali Shaikh

Can't find "Recent files" in File menu SQL Management Studio 2008


After installing SSMS 2008 the menu item File->Recent files   disappeared. I tried to add this item via Tools-> Customize. Now I can see it in menu "File" but it still doesn't work. I click on it but there is no result. What should I do to fix this problem. It is very inconvenient to open files with File->Open->File.

SQL Server 2005 rebuild indexes find corruption or cross linked files


Does anyone know if this is a known issue? What do you do when this happens? We had to go to a good backup from 3 days prior.

From the application log it appears there were cross linked files. Is this caused by the OS or Sql Server?

Pat M


PatM Reno

Where I can find these files?


RESX files in 12\CONFIG\AdminResources\, 12\CONFIG\Resources\, 12\Resources\

how can find these files?

My Personal Blog : http://Ghasemzadeh.ir

Where can I find out the Customized CSS Files on a site?


I am trying to build a provisioner.xml file by hand since the solution generator's Site definition generator will not work.  I found the listid guids and the featureid guids of the features and the keys and the values of the webproperties using SharePoint Manager.  However, I have not been able to locate the list of Customized CSS Files to populate the CustomizedCSSFiles element using SharePoint Manager, SharePoint Designer, SharePoint Sitesettings, or SharePoint Central administration or the manifest.xml file.  I found how to use SPWeb to add a file to the customizedCSSFiles collection using "CustomizeCSS" method of SPWeb, but nothing on how to return the values that have been stored using this method.  I am certain this is something easy and that I simply cannot see the forest for the trees, but right now these trees are pretty big and there are a lot of them.  I have seen references by a number of people to how they built their provisoner.xml file but no one discusses where they got this information.  So any help here would be welcome as I have run out of options.



Program to find first non repetable character in a string without using any buitin function?


Program to find first non repetable character in a string without using any buitin function?

Rendering ASPX files into a string



I am building a command line application and I need to transform data within my application's classes to text.

It would make my life easy if I could use ASPX files to render my data into the target text format.

To achieve that, I need to be able to render an aspx file outside IIS. The following article explains how:


The article is developed in 2003.

  • Is there any better way to so achieve similar result in .NET 4.0? Does MVC make this easier?
  • Is this very memory/performance intensive? I have to create a new ApplicationHost anytime my command line application is executed.
  • Is this approach reliable enough to be used in an environment with high throughput?

Thank you.

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