472,102 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,102 software developers and data experts.

regExp Experts.....

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
Jan 17 '07 #1
3 1512

"Russell" <Russell@_NOSPAM_artalacarte.comwrote in message
news:um**************@TK2MSFTNGP03.phx.gbl...
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.

Jan 17 '07 #2
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?

"Anthony Jones" <An*@yadayadayada.comwrote in message
news:uE**************@TK2MSFTNGP03.phx.gbl...
>
"Russell" <Russell@_NOSPAM_artalacarte.comwrote in message
news:um**************@TK2MSFTNGP03.phx.gbl...
>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.

Jan 17 '07 #3

"Russell" <Russell@_NOSPAM_artalacarte.comwrote in message
news:eF**************@TK2MSFTNGP06.phx.gbl...
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?


Jan 18 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Anand Pillai | last post: by
5 posts views Thread by Lukas Holcik | last post: by
reply views Thread by Chris Croughton | last post: by
26 posts views Thread by Matt Kruse | last post: by
7 posts views Thread by Csaba Gabor | last post: by
2 posts views Thread by CJM | last post: by
6 posts views Thread by runsun pan | last post: by
4 posts views Thread by Matt | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.