.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

Need regular expresion for this string

Posted By:      Posted Date: August 23, 2010    Points: 0   Category :ASP.Net

Hi All,

I would be grateful if some one can provide me regular expression for extracting just  myhomepage from below url:


Thanks in advance for replying(as always).

With Warm Regards,


View Complete Post

More Related Resource Links

Need Regular Exprfession for this string

Hi All, I would be grateful if some one can provide me regular expression for extracting just  myhomepage from below url: http://local.mysite.com/meet-manish/myhomepage.aspx Thanks in advance for replying(as always). With Warm Regards, ManishThanks and Regards,

How to read string end with question mark in regular expression?

Hello, I'm facing problem when I read string which is ended by question mark. I use in my code as the following. \"?(?<myfield>[^\"]?.*[^\"?]?)\"? If string is ended by question mark, it's not working. Please help me to solve my problem. Thanks. Co Coe

Regular Expression for looking for Colons (:) in a string

Hi I am really struggling with this! Using the regular expression validator I created an expression, thus "\:" to show an error message if the user tries to enter in a name that contains a colon. What I am getting is the error message showing even when there is no colon (:) in the string. What am I doing wrong? Thanks    

Regular expression - exclude certain string

Hi all,I have the following regular expression replacement:<add key="^/([^/]*)\.aspx\?" value="/default.aspx?pagename=$1&"/>What this is used for is URL re-writing, i.e. if a page comes in with the path "/test.aspx", it goes to the actual path which is "/default.aspx?pagename=test"This works fine, but it catches all page names. I would like to exclude a particular page name so it is not rewritten, for example if the page was called "exclude.aspx" it would not rewrite to "/default.aspx?pagename=exclude" but stay as "exclude.aspx".How do I modify ^/([^/]*)\.aspx\?so it excludes a certain page name?Thanks!

how does the string validation work for this regular expression?

 _strInt = value.ToString();
Regex objPattern = new Regex("[^ a-zA-Z]" ); if (objPattern.IsMatch(_strInt)) { return   new ValidationResult(true , null );
   } else return new ValidationResult(false , "Value must contain only alphabets" ); } }

if i pass a valid expression as "abc" .. its Failing .
Can some1 explaing how it's failing .

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

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.


Regular expression: String start with
end with
which ever comes first


Regular expression is hard. Can anyone help me with this one?

I need to get XYZ 123 and abc 134

from this html code below:


<div>XYZ 123<br />

<div>abc 134</div>


 Thank you in advance!

regular expression thar allow except ".aspx" this string


hi i am new in regular expression

can anybody understood me how can i make a regular expression that

allow all the mismatch case  and don't a match case

ex: ".aspx"

( when i put any thing in text box it allow ----a ,ab ,adn.jpg ) result=true

(but when i put =.aspx ) result= false  

Regular expression for splitting string



i have a string like this 


i want to split like this





pls help me 

thanks in advance

Regards, Anoop

Create Regular Expressions from a string programmatically


I have a situation where users can set up masks for items such as phone numbers or postal codes.  Behind the scenes in the program the mask is applied to these data values as appropriate so they can be displayed in message boxes or labels.  So for example, a user can save a mask for a phone number to be (###) ###-####, or a Canandian postal mask of &#& #&3 (Example Toronto postal code M4B 1B3).  As you can see from the two masks that # represents numbers and & represents characters.  Is there a way programmatically (VB would be nice) that you can take a mask similar to these and turn it into a regular expression pattern so the mask can be applied to a value?


Lou Davis

Regular Expression Match Exact String


I'm looking for a regular expression that satisfies one of the two conditions (Reg Expression OR Exact String Match W/ Underscores) listed below.





Thanks in advance

How to Encrypt Query String Parameters in ASP.NET

Encrypt Query String Parameters in ASP.NET.u can send secure data one page another page u can also use query string to encrypt

Connestion string create any database server

This links important to how to create connection string to any data base sever.

SQL Connection String

We can learn or know how can we connect the database from our .net. This will help for freshers or .NET beginners!

Built-in Functions - String Functions

String functions let you extract various portions of character strings, change the case of strings, concatenate and reverse strings and perform many other types of manipulations. All built-in string functions are deterministic with the exception of CHARINDEX and PATINDEX

abstract away the source of the connection string using a class with a static property.

ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results.

The element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production.

Let's abstract away the source of the connection string using a class with a static property.
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