parsing Rich text strings from a SQL Database

Last post 11-29-2005, 2:54 PM by Adam. 1 replies.
Sort Posts: Previous Next
  •  11-29-2005, 9:20 AM 13173

    parsing Rich text strings from a SQL Database

    I am using an inexpensive work order application called Express Maintenance that as written in Delphi/C++. In order to have high availability I created a web app. (ASP.NET, VB) for my users to create work orders. Right now they can create work orders with no problem, but I would like them to be able to see the completed work orders also. My problem is that the notes section of the completed work order is stored in rich text and this is what the raw data looks like in the database.

    {\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil\fcharset0Arial;}{\f1\fnil Arial;}} \viewkind4\uc1\pard\lang1033\b\fs24 Track ItWork Order Number 7256\b0\f1\par }

    The only part that I want to show up is "Track It Work Order Number 7256"

    Does this control parse the rich text formatting parameters so it will just display the notes text only.

  •  11-29-2005, 2:54 PM 13189 in reply to 13173

    Re: parsing Rich text strings from a SQL Database

    mastroem,

    You can use the regular expression to parse the above string.

    Try:

    Java Script:

    String_Html = String_Html.replace(/\w*(Track ItWork Order Number \d{3})\w*/gi, '"$1"');

    C#:

    String_Html = Regex.Replace(String_Html, "\w*(Track ItWork Order Number \d{3})\w*", "$1", RegexOptions.IgnoreCase | RegexOptions.Multiline);

    Hope it helps.

    Let me know if you have any further questions.
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML