.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

How to convert .html format data to normal text using Regular Expressions?

Posted By:      Posted Date: September 25, 2010    Points: 0   Category :.NET Framework
How to convert .html format data to normal text using Regular Expressions?

View Complete Post

More Related Resource Links

SQL Server 2005: Regular Expressions Make Pattern Matching And Data Extraction Easier


Now you can perform efficient, sophisticated text analysis using regular expressions in SQL Server 2005.

David Banister

MSDN Magazine February 2007

Want to convert html page into pdf format & send same pdf as a attachment

Dear All i want to convert html page into pdf format & i have to send that same pdf  by attachment,if some one has the sample code , please send me

how to convert the text to mp3 speech format

im working on a applicatio that will speak out a text file for you. i have code to read a text file but can not directly convert and save in mp3 format.. need help.. :)

Need to convert query string(date - 09/15/2010) to a text format - yyyymmdd

I am fairly new to C # and need some assistance with a form page.  I have created a simple form that requires the user to select a beginning date and ending date.  I then pass the values to my code behind page via query strings.  I have them passing, but I need the format to be change to a different format.  Unfortunately the database does not use the standard date format.  It requires the date to be in a text format as YYYYMMDD.Form: <tr> <td> Beginning Date:</td> <td><asp:TextBox runat="server" ID="begDate"></asp:TextBox> <asp:Image ID="Image2" ImageUrl="~/images/calendar_schedulehs.png" runat="server" /></td> </tr> Code Behind: protected void createReport_Click(object sender, EventArgs e) { StringBuilder url = new StringBuilder("Report/TopCustomer.aspx?"); url.Append("BegDate=" + begDate.Text); url.Append("&EndDate=" + endDate.Text); url.Append("&Brnch=" + ddlLocation.SelectedValue); Response.Redirect(url.ToString()); Current URL: TopCustomer.aspx?BegDate=09/15/2010&EndDate=09/30/2010&Brnch=300I need to have the above URL change to:TopCustomer.aspx?BegDate=20100915&E

Reading WPF rich text box content in HTML format

Hi, I am using WPF RichTextBox. From that, I am reading the content in RTF format using the following code. TextRange textRange = new TextRange(paramRichTextBox.Document.ContentStart, paramRichTextBox.Document.ContentEnd); MemoryStream msData = new MemoryStream(); textRange.Save(msData, DataFormats.Rtf); //get the data from the selected range //strData = textRange.Text; strData = ASCIIEncoding.Default.GetString(msData.ToArray()); I also found that there is an option called DataFormats.HTML. Hence, I tried using this but ended up with error. Is there any other way to read the content of RichTextBox in HTML format? Thanks in Advance!!! Best Regards, Subalakshmi Vijayarajan.

Maxlength & Regular Expressions for text boxes


So over here, I'd asked about Regex and methods of limiting user input in text boxes, and got some very good answers, but I've hit another snag.

1) Using "Maxlength=XXXX" works great for single-line text boxes, but doesn't prevent the user entering too much text in multi-line text boxes. I wouldn't mind that, but it also doesn't trigger an error to display to the user, it just doesn't let the page submit.

2) So I've been using Regular Expressions (i.e, .{0,50} ) to pop up an error message when the user enters too much text. However, there's again a problem with multi-line text boxes. Using the dot for the validation expression does not allow the user to enter line breaks. Using \r\n will allow line breaks, but that's it. I keep looking at RegEx references online, and I can't find a way to allow both. Any combination or \r\n and . that I've tried has resulted in the expression allowing only line breaks.

So my question is this - what Regular Expression should I use to allow text (any character) with line breaks? Or, is there a better/simpler way to handle this?

 Thanks a million!


Loading rtf with image gives "Unrecognized structure in data format 'Rich Text Format'.\r\nParamet


I'm trying to load this rtf into a RichTextBox:

{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2{\fonttbl{\f0\fcharset0 Times New Roman;}{\f2\fcharset0 Segoe UI;}}{\colortbl\red0\green0\blue0;\red255\green255\blue255;}\loch\hich\dbch\pard\plain\ltrpar\itap0{\lang1033\fs18\f2\cf0 \cf0\ql{\f2 {\ltrch >> -----------------------------------------------------}{\ltrch \line }{\ltrch >> 19-10-2010 11:22}{\ltrch \line }{\ltrch >> -----------------------------------------------------}{\ltrch \line }\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\ltrch {\*\shppict{\pict\picwgoal1020\pichgoal1035\pngblip

How to insert dynamic data into an XML or HTML format table


Hi there,

I have a technical problem as the title described. I need to achieve this by SSIS that means the destination file could be XML or HTML. However, before inserting dynamic data from source, an XML or HTML format table must be predefined. In the final destination file, the predefined table and dynamic data will be both output.

Can anybody give some suggestions or reference links regarding to this? Appreciate it.


Format a TEXT data type


I have a report that pulls data from a TEXT data type column.  When users type data into the database, hitting the ENTER key will start a new line.   When I pull the text onto a report it pulls all the text as one long string. The spaces are there but the ENTER gets ignored.  This makes the information hard to read.   Is there any way to read up the ENTER character and have the report format the text accordingly?  Or some other way to accomplish the same goal?


Convert text to HTML



I'm using WPF and dotnet 3.5 for my application. Now I want to convert a string value to html. In this case it's only about all special letters as & % å ä ö etc, since the rest is already in html. How to do this? I have seen articles about htmlencoder, but in wpf and dotnet 3.5 I can't find this object.

Please help

Magnus Burk

Rendering data with HTML tags in the DD Gridview for a selected column


I am having trouble finding out where and how to HTML Encode a cell's data on the Dynamic Data (v4.0) gridview of List.aspx.  As a simple case, suppose I have formatted cell data that is A<br/>B in the DB.    Obviously, I want A stacked on B in the cell.

It seems gridView1.HtmlEncode = true has gone away.

So maybe I'll try to catch it on the RowDataBound event:

protected void GridView1_RowDataBound(Object sender, GridViewRowEventArgs e)

            if (e.Row.RowType == DataControlRowType.DataRow)
                // Html Encode the cells


but this event never fires?

Has anyone figured out how to properly render HTML tags data in the List.aspx's GridView1? 

If I figure this out, then I can add a MetaAttribute called something like [EncodeAsHtml(true)] and be on my way.  Thanks!

convert SQL data to EDI 835 file


I was assigned to create a app to convert SQL data to EDI 835 file. (Electronic Data Interchange file for Health Care Claim Payment/Advice,  outbound process only).

Can someone help me where to start?

How to Convert HTML to Image


 HI all,

I was struggling for the process/code to convert html to image. Please suggest any tutorials for this. And also any code help greatly appreciated.


thanks and regards,



Toolbox: Online Scheduling, Jeff Smith's SQL Blog, Easy Regular Expressions, And More


This month Scott looks at improving development skills, writing regular expressions, a web scheduling control and a SQL tips blog.

Scott Mitchell

MSDN Magazine November 2008

Data Points: Common Table Expressions


In T-SQL, views and derived tables serve similar purposes and have their advantages. But when working with SQL Server 2005,there's a third option--using Common Table Expressions (CTEs). John Papa explains.

John Papa

MSDN Magazine October 2007

Toolbox: Rich Web App UIs, Tools for Regular Expressions, and More


In this issue, create rich Web app UIs, explore tools for regular expressions, and create screen mockups.

Scott Mitchell

MSDN Magazine February 2007

Data Points: Column Expressions, DataRelations, and Computations


This month John Papa fields some of his favorite questions regarding data manipulation with ADO.NET.

John Papa

MSDN Magazine January 2007

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