This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Replace unuseless characters in a String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Replace unuseless characters in a String" Watch "Replace unuseless characters in a String" New topic

Replace unuseless characters in a String

Mirco H Schmidt

Joined: Aug 25, 2010
Posts: 7

I have a String, where I want to replace all the text starting from "{\\rtf1\\ansi" until "\\fs24",
both marked in BOLD.
Can anybody help, how I can replace this with regular expressions ?
Thanks Mirco
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10651

mirco schmidtfo wrote:

Please check your private messages for an important administrative matter.

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Rob Spoor

Joined: Oct 27, 2005
Posts: 19911

That looks like RTF, which means that these characters are most definitely not useless. Check out AccessingFileFormats for tips on reading RTF files.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: Replace unuseless characters in a String