regExp Experts.....

R

Russell

hey,

I'm struggling trying to get the concepts of the regExp function down....

What i'm trying to achieve is to remove all white space from html formatted
source code.

I have the following regExp search string to remove all html source code but
that is not what i require..
RegExp.Pattern = "\<.*?\>"

I want to store all html source code and its text/image contents into a DB.

For that reason i want to remove all line breaks and spacing/tabs within the
source code so as to only have one exteremely long single line leaving the
formatting of the contents of the html code alone all so that i can stuff
into a varchar(MAX) field

thanks!!!
R
 
A

Anthony Jones

Russell said:
hey,

I'm struggling trying to get the concepts of the regExp function down....

What i'm trying to achieve is to remove all white space from html formatted
source code.

I have the following regExp search string to remove all html source code but
that is not what i require..
RegExp.Pattern = "\<.*?\>"

I want to store all html source code and its text/image contents into a DB.

For that reason i want to remove all line breaks and spacing/tabs within the
source code so as to only have one exteremely long single line leaving the
formatting of the contents of the html code alone all so that i can stuff
into a varchar(MAX) field

Why is removing all this whitespace important?
Are you sure that all the whitespace is insignficant? there are times where
certain markup fails to render quite right when whitespace typically present
is removed.
 
R

Russell

I guess removing it is not that important and i am aware of how XML
whitespace is imoportant though for standard HTML. its nothing more than a
formatting language.

Would you happen to know of the regExp.Pattern string i should use?
 
A

Anthony Jones

Russell said:
I guess removing it is not that important and i am aware of how XML
whitespace is imoportant though for standard HTML. its nothing more than a
formatting language.

Would you happen to know of the regExp.Pattern string i should use?

None that you can be sure 100% won't be causing a problem. However you can
be sure that storing the HTML with it's existing whitespace is 100% problem
free. What benefit is derived from this procedure do you get that is worth
the risk introduced into the system?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,129
Messages
2,570,769
Members
47,326
Latest member
Itfrontdesk

Latest Threads

Top