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

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

File.Regex Expression for editing

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :WPF

i am really a beginner in file.regex so if someone explain me how can i search for this expression.

this.label1.Text = "Version      1.1.1.Beta";

How will i write this in file.regex regular expression ??

i want to search this through file.regex and then set new value here through tfsbuild. so please help me as i am really freaked out and cannot find my way out.

View Complete Post

More Related Resource Links

regular expression for file upload box

I have a regular expression that check for filenames in upload file dialog box . The main aim is to disallow any special characters in filenames.  ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w\-\. ]*))+\.([a-zA-Z]*)$" But this one will not allow filenames with back slashes   I want to modify the reg ex to except both of the following type filenames c:\temp\abcd.txt  and also the way filenames are displayed in firefox browser (with backslashes) file:///c:/BIDS2/abcd.txt   I need help with modifying the regex, so that it excepts both   Thank you

NullReference Exception when editing an xml file in C#

When trying to add new node to Category node, I get categoryNode is null, but it exists in xml file CODE: XmlDocument     xmlDoc = new XmlDocument(); xmlDoc.Load(requestPath);     XmlNode categoryNode = xmlDoc.SelectSingleNode("CATEGORY");     XmlNode newNode = xmlDoc.CreateElement("REQUEST");     XmlAttribute newAttribute = xmlDoc.CreateAttribute("description"); newAttribute.Value = request.GetId(); newNode.InnerText =   "blank"; newNode.Attributes.Append(newAttribute); categoryNode.AppendChild(newNode); xmlDoc.Save(requestPath);   FILE: <GROUP description="Kwang">   <CATEGORY description="soo">blank</CATEGORY>   </GROUP>

How to change the split view when editing an aspx file

I've been using SPD 2010 more and more over the past few weeks.  However, when there's a navigation bar on the left, toolbox on the right, ribbon above and split view of code and design in the middle, there's just not enough room on the screen - (I have 2 LCDs at 1280x1024).  I can spread the window accross both monitors but that's not much use unless, I can change the split between code and design from horizontal to vertical. Is this possible?  Help apprieciated. Cheers, Bill

.Net Regex engine seems to hang for the given expression and input

Provided pattern:


Input Test
public List<String> TestFunction(string input, List<String> CategoryList, object[] obj)

Please provide an earliest answer/remedy for the provided expression. I have tried to find relevant documentation of bugs but have not found any clues. Tested on regex test engines as well. But behavior happens to be same in all the cases.


Editing a resource file is not reflected in the site?



I am editing core.resx file which is located at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Resources location.

I am changing :

<data name="cui_ButNoteBoard">
    <value>Note Board</value>


<data name="cui_ButNoteBoard">

Basically I want to customize the dialog box which appears on click of the comments icon present on the right side of the page header in SP 2010. I want to change the title of one tab in dialog box(from 'Note Board' to 'Comments').

But the change is not reflected in the tab title. Am i missing something here or updating the wrong resource file?

Please guide.



Does Regular Expression (RegEx) able to extract Sentence from paragraphs



I am new to Regular languages; I have been trying to find out whether Regex is able to extract sentences from any paragraph (text) on PDF format based on particular words (pattern).



Can you please outlines this with example in C#


Thank you in advance  

Defining a regular expression in the application settings xml file.


I have a little question about application settings. I have a regular expression in my code which should be customizable by the user so I made an application setting for it.  The regular expression is used in a class in the project and has the following value

Dim email_regularex As String

So now I made a new Settings file in my project and gave the following value for this string in the settings file:



So when i do this in Visual Studio 2008, Visual Studio automatically creates a app.config xml file with the right settings in it.

But when I start my application and use the regular expression like this:


 myMatch As

 Match = Regex.Match(email, email_regularex)


 myMatch.Success Then

 MsgBox("Please enter a valid email address like: iiiiii@iii.com"

, MsgBoxStyle.Critical)


the application break

Server error: is checked out or locked for editing by ... but page does not exist


I tried to rename a page in the source variation of a Publishing Site using Site Content and Structure tool, let's call it "newpage". This threw an HTTP 500 error. I then tried to rename it in SharePoint Designer. I got two message prompts, the first said:

"A file with the name Pages/newpage.aspx already exists. Do you want to replace this file?"

There is no file of that name in the Pages list in either the source or target variation. I said "Yes" and got the following error:

"Server error: The file <path>/newpage.aspx is checked out or locked for editing by ."

No user name was given in the message. I can successfully rename the page in the target variation to have the new name.

I also cannot create a new page in the source variation called newpage.aspx, I get an error saying that there is already a page of that name ... but there isn't. I have cleared the site and site collection recycle bins.

spfile.delete gives file is checked out or locked for editing exception.


hello friends,

i have developed a custom webservice wherein i try to move the spfile within a document library between two folders. I tried with spfile.delete but it gives me exception.

System.Runtime.InteropServices.COMException (0x8107090E): The file is a user http://tsnt4-test/espis/Lists/TSAkJKDocuments/154545445-342423/abc.doc DMTSIT \ spospisilova checked out or locked for editing.

even when i try to use spfile.copyTo and spfile.moveTo it gives me the same exception

i used the following two approaches

  //Approach 1

RegEx - fetching parts of file name


Hi all,

I have to admit that regular expressions is one of the topics I should learn more about...can someone help me out here? What I need is the numbers between the two underscores as one column and whatever is between the "jb" and the ".jpg" in another column. How would I go about doing this...?? ->

 ('0001_56311_jb302,086.jpg'), ('0002_212311_jb302,066.jpg'),
 ('0003_2311_jb302,046.jpg'), ('0004_11_jb302,026.jpg')
SELECT Filename, Col1 = PATINDEX('_[??]_', Filename), Col2 = PATINDEX('jb[??].jpg', Filename) FROM @table AS t



Unable to read the security policy file for trust level 'WSS_Minimal' after editing 'Alternate Ac



This is my first post, so I hope that I have picked the correct forum - it seemed the most appropriate.
I am pretty green when it comes to SharePoint admin, but as it was going so well I got a bit over-confident and tried out the 'Alternate Access Mapping'.  I didn't intend to save any changes, but I must have, because now under:

Central Administration > Operations > Alternate Access Mappings >
Edit Public Zone URLs

the 'Default' is "http://<myServer> : <port>"

and afaik there was no setting there before.  Unfortunately, I can no longer connect to http://myServer : port, although I can connect to the 'Central Administration' site on http://myServer : otherPort.  Apologies in advance for the data dump below, but if anyone has any suggestions on what I could've done (or even better what I could do to fix it before tomorrow :-) I would be very grateful.

Here are the errors that I saw/see in the browser:

Looking for a RegEx expression to eliminate extra whitespace in a line

I have a db column that allows users to input freeform text for, say, a firm name. I would like to remove extra whitespace between names, such that "The   Irvine Company" would become "The Irvine Company". What is the best way to do this?

avoid application freeze from regex.macthes using user entered expression


To my chargrin, I discovered using time limited thread  for regexMatch will not allow abort and still freeze the application.


However the freezing can be avoided despite bad user greedy expression if we precede the the matches inside the thread with


 if (!myRegex.IsMatch (...))


  // some sort state setting including message protected internal variable to indicate timeout



// then the actual matches statment

here is a sample inner class that can be used to do time limted matches

 private class MkMatchSvr


 private string sInput;

 Regex myRegex;

 protected internal string sOut;

 protected internal bool bOut;

 protected internal MatchCollection myMatch;


Regular expression to validate file path


Hello all,

Would you please share me a regular expression to validate a file path?

Note that the file path can be any valid file path {local, shared and network} as well.



File Splitter in .Net

I love to do utility programs in .Net. And this is one of them. As I was playing with JSplit (a free file splitter program), I wondered if I could do it in .Net. The framework supports file operations like reading files in bytes and creating them. It is indeed easy to do file operations in .Net Basics on File operations

Editing the Data in a GridView

In addition to deleting a GridView's underlying data, another common need is to allow end users to edit the data displayed in a GridView. With ASP.NET 1.x's DataGrid control, editing the data is certainly possible, but requires creating three event handlers and writing a dozen or so lines of code. With the GridView and ASP.NET 2.0, it is possible to create an editable GridView without writing a single line of code! All of the necessary functionality is encapsulated within the GridView.

The GridView allows editing on a row-by-row basis. An editable GridView contains an additional column with an Edit button in each row. When the end user clicks on an Edit button that row becomes editable, causing the Edit button to change to Update and Cancel buttons and the other columns to become TextBoxes. The end user can then update one or more column values and click Update to save their changes.

How Do I Enable Inline GridView Editing?

Now that you have created a site with Edit and Details views, how do you enable inline editing in a GridView control? This video shows you how, and also touches on routing.
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