Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7897599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:12:27+00:00 2026-06-03T08:12:27+00:00

i write a simple Rss Feed reader now i have this problem, in the

  • 0

i write a simple Rss Feed reader now i have this problem, in the item description i have the text but this text have this caracters <br/>
for example

“my dog <br/> is black and he <br/> stay on table “

now i wont to clear the string from this caracters, i wirte this metod

private static String IsMatch(String s, String pattern) {
    try {
        Pattern patt = Pattern.compile(pattern);
        Matcher matcher = patt.matcher(s);
        return matcher.group();
    } catch (RuntimeException e) {
      return "Error";
    } }

and

String regex ="[<br/>]";

theString2=IsMatch(theString,regex);
 AppLog.logString(theString2);

but But this method return always Error. Can any one tell me what’s the problem?

best regads
Antonio

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:12:29+00:00Added an answer on June 3, 2026 at 8:12 am

    The problem is that you never invoke find() on your matcher. You must invoke find() before invoking group() (and test that find() returns true).

    I am not sure of what your method IsMatch is supposed to do. As it is, it will either return the match (ie, "<br/>", assuming you invoke find() before) either return "Error".

    Also, don’t put the brackets around <br/> in your regexp, they are not needed.

    I wouls really consider using replace instead of regexp for your purposes:

    String s = "my dog <br/> is black and he <br/> stay on table ".replace("<br/>","");
    

    As a recommendation, don’t catch an exception without logging the it. They provide valuable information that should not be hidden. It make debug really hard when a problem occurs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanna write a simple RSS Feed reader in C++. I understand that the
I am usually pretty good to write simple regular expressions, but this time I
My boss wants me to write a simple RSS feed for an C++ MFC
I try to write simple application using OpenMP. Unfortunately I have problem with speedup.
I am trying to write a very simple RSS channel which would display the
I am new with Scala and I am writing a simple rss reader. I
I'm trying to write an XML parser that takes an RSS feed & fetches
I am trying to write a simple RSS parser for my website. Although I
I write simple C++ code that compute array reduction sum, but with OpenMP reduction
I am very much an Android newbie and I have built a simple RSS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.