What does 'm.group()' return?
I'm also confused by when you say it returns 'nothing'.
Integer.parseInt() will either return a number, or it will throw an
exception, I've never seen it do any different.
Are you getting an exception?
Mark
On 7/8/05, Taco Fleur <[EMAIL PROTECTED]> wrote:
>
>
>
> Sorry guys, I tried a Aussie Java Mailing list but got a message back from
> the moderator basically saying my question was to silly for them.
>
>
>
> So here goes in the hope someone here can answer this.
>
>
>
> I need to parse an integer out of string with a regEx.
>
>
>
> I tried:
>
>
>
> Pattern p = Pattern.compile("([0-9]*)");
>
>
>
> Matcher m = p.matcher("BDAT 24 LAST\nEND");
>
> if (m.matches()) {
>
> byteToRead = Integer.parseInt(m.group(1));
>
> System.out.println("byteToRead = " + byteToRead);
>
> }
>
> But it gives me nothing, even when I use "." as the regEx.
--
E: [EMAIL PROTECTED]
W: www.compoundtheory.com
ICQ: 3094740
---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/