Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

please help me  RSS feed

 
Rahul....gupta
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends
have 1 prob in java.util.regex

i have string------- href="www.abc.com"

and i have to replace this with-------href="http://www.xyz.com?r=www.abc.com"
using regular expression.

if any space is there between href = i have to omit that also and if ' is there instead of " that also to be matched.

thanks dost
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you should be able to do that with Java regular expressions (Pattern, Matcher). You might use MessageFormat, too. Have you read the API on these classes? What isn't clear?

While I'm here, this question would have been better in Java In General Intermediate forum (CarefullyChooseOneForum). Also, UseAMeaningfulSubjectLine.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Rahul....gupta ",
Please check your private messages.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!