• Post Reply Bookmark Topic Watch Topic
  • New Topic

ereg_replace aka regexp in jsp

 
Carsten Rasmussen
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can somebody tell me how to do a textreplacement with some kind of command.


In php we do rex like this:


Can it be done in JAVA Servlet or JSP.
And now we are at it is there command in jsp to strip HTML code.

Please help me.
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how about

 
Carsten Rasmussen
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its more like a regexp im looking for.
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just saw that this is a jsp related questions.

Check how this tag library works:

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

http://www.j2ee.me/products/jsp/jstl/1.1/docs/tlddocs/fn/tld-summary.html
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carsten Rasmussen wrote:Its more like a regexp im looking for.


Why would you engage the heavy regex engine if a simple replace does just fine ?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65519
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have done a poor job at explaining what it is you are looking for. Perhaps another post clearly explaining what you are after would be useful?
 
Carsten Rasmussen
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There it is. is that good enough. ???
 
Carsten Rasmussen
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I googled and googled and more google then i came to this solution:


Gat it working from 2 or 3 examples put together and it does work ( very proved ) did the regexp by myself.
Still open for better solutions.

??? Something wrong with code block
 
Carsten Rasmussen
Ranch Hand
Posts: 65
posted 7 years ago
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May i change the link regexp to:


That wil make http://blablabla untill space to a link.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!