File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes how to use Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to use "Pattern" class as delimiters for Scanner?" Watch "how to use "Pattern" class as delimiters for Scanner?" New topic
Author

how to use "Pattern" class as delimiters for Scanner?

Fendel Coulptz
Greenhorn

Joined: Sep 23, 2004
Posts: 24
Hi,

in a string "abcd<<<<1234^^^^", if i want only abcd and 1234, what should i type in the Scanner scanscan = new Scanner(System.in).useDelimiter(...) method? how do i use the Pattern class? i've read the api page, tried the stuff on the list but can't manage to compile.

thanks alot.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Why don't you post a short bit of what you have. That will help us see just what is hanging you up ... regular expression syntax, the Scanner API or something else.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to use "Pattern" class as delimiters for Scanner?
 
Similar Threads
Regex and Generics Notes/Questions
some queries
is it good practice?
Read rest of the string with Scanner class
Highlighting a portion of text in a textarea