Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 7th, 2006, 04:35 AM
Registered User
 
Join Date: Feb 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default regular expression extraction paragraph

Hi,

   The regex

    \(\((\w*?\W*?)*?\)\)

    is working in regex tester

    http://regexlib.com/RETester.aspx



once i apply this in my code it is showing "index was out side the bounds of the array error"

any suggestions?

My code

string strInput = TxtInputString.Text; //<- input

string strRegEx = TxtRegex.Text; //<- RegeX

Regex DateLineRE = new Regex(strRegEx,RegexOptions.Multiline);

MatchCollection matches = DateLineRE.Matches(strInput);

foreach(Match match in matches)

{

MessageBox.Show(match.Value);

}


input is

MultiChoice said it welcomed competition, which would ensure
more choice and programme diversity.
    "It will be good for the pay-TV industry ... and attract the
necessary investment into the broadcasting industry and the
South African economy," Chief Executive Nolo Letele said in a
statement.
    Shares in Naspers were up 0.87 percent at 127.60 rand at
1402 GMT, when the top-40 index of blue-chip stocks &lt;.JTOPI&gt; was
up 0.94 percent.
 ((Reporting by Rebecca Harrison, editing by Greg Mahlich;
Johannesburg newsroom +27 11 775 3159;
[email protected]))

output is
((Reporting by Rebecca Harrison, editing by Greg Mahlich;
Johannesburg newsroom +27 11 775 3159;
[email protected]))

Thanks in advance

Radhakrishnan.k









Similar Threads
Thread Thread Starter Forum Replies Last Post
Regular Expression Help Please rstelma ASP.NET 1.0 and 1.1 Professional 0 January 2nd, 2008 07:01 PM
Regular Expression Help pallone Javascript 2 October 19th, 2007 03:59 PM
Regular Expression Help Greg Griffiths Javascript How-To 4 November 12th, 2004 05:33 AM
Regular Expression DARSIN General .NET 2 November 9th, 2004 08:30 AM
Regular Expression Help Hadware .NET Web Services 3 November 4th, 2003 10:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.