.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

Regular Expression to match "="(45167)" and retrieve only the code inside parentheses

Posted By:      Posted Date: October 03, 2010    Points: 0   Category :.NET Framework


Need a Regular Expression to match "="(45167)" and retrieve only the code inside  parentheses say 45167

thanks in advance

View Complete Post

More Related Resource Links

Regular Expression to Match


Here is the kind of text I want to match via a regular Expression

The id="dgSchedule" is always present in the TAG but its location may differ

The table is span over multiple line/contains white spaces/tabs...

I have the regular expression to match the start and end tag respectively over a single line

\<table .*\>


The problem is to match the whole table span over multiple lines

<table cellspacing="0" rules="all" border="1" id="dgSchedule" style="border-style:None;height:100%;width:100%;border-collapse:collapse;">
	<tr class="blackbar" align="center" style="background-color:#7FB4DE;font-family:Verdana;font-weight:bold;height:20px;">
		<td>From Place</td><td>To Place</td><td>Time</td><td>Bus Type</td>

	</tr><tr style="background-color:#DEECF5;">
	</tr><tr style="background-color:#EFF5FA;">
	</tr><tr style="background-color:#DEECF5;">


Regular expression to match for -


I need my string to be a minimum of 8 character, begin with 3 alphanumber,  end in alphanumberic and contain atleast one -

Below is what I have that includes everything but testing for inlcusion of atleast one -


string example to work with...

abc-1234,  123-adjoq-jadfoqe, 123abc-a

Strings that should fail...

as-jdsdjf, a-a-dfa, acb-3gh, abc-1234-


Problem Excluding Section In Quotes From Regular Expression Match


Hi There,

Currently I have the string:

"WHERE Column_1_Name = 1 AND Column_2_Name = 'Test Column Criteria'"

& my desired matches are as follows:




However, so far, I can only achieve

'Test Column Criteria'

via: (([a-z][\w]+)|('[\w ]+'))(?!('[\w ]+'))




via (('[\w ]+')|([a-z][\w]+))(?<=\3)


All help appreciated much appreciated.

(I'm using the .net engine, case insensitive)

Regular Expression needed for 10, 11, or 12-digit number in code behind


Hi there,

I am in need of validating a number that can be 10, 11, or 12 digits in lenght.  It cannont contain any spaces, symbols, or letters.  I have to do this in the code behind of my web form.  I am using C# ASP .NET 2.0. 

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

Can we use regular expression to match numbers not preceded by a specified set of characters


I have been trying to come up with a RegEx that would match numbers (including decimals and negative numbers) that are not preceded by a specified set of characters. For example:

Specified set of characters (not including comma): c, t

Input string: “This c2 is one element. And t-4a, d25, c2.54, v4.28, q58 are other elements”

Desired result (the numbers not preceded by c and t):

The pattern I tried: [^ct](-?\d+\.?\d*|\.\d+)

The matches I got (Note: I fetched the results from Group 1):


I don’t want the numbers in bold to be returned since in t-4a the integer -4 is preceded by t, and in c2.54, 2.54 is preceded by c.

Can we refine the above pattern or is it even possible?

Thank you.

How to match regular expression in c# with two grouped expressions

I would like to match a string separated by "/" followed by an expression like 1..100 and again string separated by "/" followed by 1..100, here is the string format.
here is my regular expression 
Regex regAppDH = new Regex(@"/String1/String2/String3/stirng4(\[[0-9]|[1-9][0-9]\])/string5/stirng6\[[0-9]|[1-9][0-9]\]")
This regular expression does not match after the first group expression ( before string5)  , can any body help to get this expression working.
stirng1,string2,string3,string4 and string5,string6 are alpha numeric and fixed. 


Security Briefs: Regular Expression Denial of Service Attacks and Defenses


Microsoft security expert Bryan Sullivan believes denial-of-service blackmail attacks will become more common as privilege escalation attacks become more difficult to execute. He demonstrates how to protect your apps against regular expression DoS threats.

Bryan Sullivan

MSDN Magazine May 2010

CLR Inside Out: Code Contracts


This article will share some of the best practices that the Base Class Libraries (BCL) team devised as they added the code contract libraries and started to take advantage of them in their own code.

Melitta Andersen

MSDN Magazine August 2009

Inside Microsoft patterns & practices: Building WPF and Silverlight Applications with a Single Code


This article discusses the Project Linker tool and other techniques to create applications that target both WPF and Silverlight from a single code base.

Erwin van der Valk

MSDN Magazine August 2009

CLR Inside Out: Best Practices For Managed And Native Code Interoperability


There are many factors to consider when building your app with both managed and native code. Find out how to employ interop and how to choose the interop that's right for you.

Jesse Kaplan

MSDN Magazine January 2009

CLR Inside Out: Marshaling between Managed and Unmanaged Code


Marshaling is an important part of .NET interop. It allows you to call into unmanaged code from managed code. This column will help you get started.

Yi Zhang and Xiaoying Guo

MSDN Magazine January 2008

CLR Inside Out: Writing Reliable .NET Code


Here's a look at how code fails and techniques for writing more reliable and resilient managed code.

Alessandro Catorcini and Brian Grunkemeyer

MSDN Magazine December 2007

Hanselminutes Podcast 227 - Inside Expression SuperPreview with developer Mike Calvo

Scott talks to Mike Calvo, a Microsoft Lead Developer based out of Minnesota (!) about Expression SuperPreview. SuperPreview helps developers and designers with cross-browser CSS and HTML issues. How'd they build it and with what? What's inside? How does the cloud fit in and how do they support Safari? I played with SuperPreview a bit last year, but started looking at it again last month when I noticed that version 4 has introduced support for Safari on Mac via a Cloud-based Remote Service. I fired up Expression SuperPreview 4, and saw this: Then I signed up: Which enabled Mac Safari for this initial beta. I assume they'll add a pile of other browsers. If I don't see immediate browser support for ALynx, the Amiga port of Unix...(read more)

Repeater issue, all code inside Repeater are not shown


I have a Repeater who should show some data from my ms.sql server. But all code inside the Repater is not shown on my .aspx page. What am i doing wrong. I have a similar Repeater on another page and there it works fine.


 <div class="AnsaettelseKontrakt Folders">
      	            <table cellpadding="0" cellspacing="0" width="750px" align="right">
                            <th class="BrugerHeader" style="width:300px;">Filnavn</th>
                            <th class="BrugerHeader" style="width:80px;">Størrelse</th>
                            <th class="BrugerHeader" style="width:150px;">Dato</th>
                            <th class="BrugerHeader" style="width:180px;" colspan="2">Brugere</th>
                            <th class="BrugerHeader" style="width:40px;">Værktøjer</th>
                        <asp:Repeater ID="RepeaterAns" runat="server" onitemcommand="Repeater1_ItemCommand" >
                                <tr class="Br

Help with regular expression


I am using this regular expression: /.*-lyrics-.*$

and I need the expression find urls like this:

and it do really does that!

The problem is that it finds also this URL:

Whar regular expression should I use to exclude urls that end with /lyrics ?

Thanks :]



Need a regular expression


I have a required field validator for a texbox, but I just found out that the texbox can have a space in it (for a delimiter, let's say).

I checked the .net and regexlib.com, but couldn't find what I was looking for.

I simply need a regular expression that basically excepts any character string including spaces in it or even a space by itself

Can someone help me out?

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