The Artima Developer Community
Sponsored Link

Java Answers Forum
Java & RegEx

1 reply on 1 page. Most recent reply: Nov 23, 2003 7:32 PM by Senthoorkumaran Punniamoorthy

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Senthoorkumaran Punniamoorthy

Posts: 335
Nickname: senthoor
Registered: Mar, 2002

Java & RegEx Posted: Nov 23, 2003 7:31 PM
Reply to this message Reply
Advertisement
Hi Guys,

I have a String, where I want to extract a portion of it based on a Regular Expression.

Say if my String is

String regex = "test<123>test";

I need to extract the numeric part of it which is inside the <> signs. So I could use the RegEx as <[0-9]*> (kind of).

But the problem is I checked up the String class API and it has support for only matching, that is I would know whether there is a regEx like this. But how can I extract it and store it inside another String.


Senthoorkumaran Punniamoorthy

Posts: 335
Nickname: senthoor
Registered: Mar, 2002

Re: Java & RegEx Posted: Nov 23, 2003 7:32 PM
Reply to this message Reply
Found the answer

http://www.ingenio.co.uk/java/regexps2.html

Flat View: This topic has 1 reply on 1 page
Topic: Hey Help Me please really Impo Previous Topic   Next Topic Topic: arrrrgghhh

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use