I had the same problem. I found some .Net code that people were using
in a related situation, and adapted it to this.
It would be better if it did case-insensitive regex matching, but this
seems to work at the moment.

        public static String deWordify(String in) {
                String out = in;
                out = out.replaceAll("<!--(\\w|\\W)+?-->","");
                out = out.replaceAll("<title>(\\w|\\W)+?</title>","");
                out = out.replaceAll("\\s?class=\\w+","");
                out = out.replaceAll("\\s+style='[^']+'","");
                out = out.replaceAll("<(meta|link|/?o:|/?style|/?div|/?st\\d|/?
head|/?html|body|/?body|!\\[)[^>]*?>","");
                out = out.replaceAll("<(/?SPAN|/?FONT|/?A)[^>]*?>","");
                out = out.replaceAll("(<[^>]+>)+&nbsp;(</\\w+>)+","");
                out = out.replaceAll("\\s+v:\\w+=\"[^\"]+\"","");
                out = out.replaceAll("(\n\r){2,}","");
                return out;
        }

John.

On Sep 18, 12:19 am, javalover <[email protected]> wrote:
> Hi All,
>
> In theRichTextAreawhen i copied and paste data from MSword document
> it is generating some msword junk data .Could you please give me
> suggestion is there any method or any solution for this problem.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to