Hi

can anybody help me write a regular expresion for a string like this

"X,Y,Z,A,B,C,Time"

X,Y,Z,A,B,C is a 3 digits number

Time is a double value with anynumber of digits with two decimal places.

Thank you very much

Printable View

- 01-04-2011, 08:52 PMmohammedelbesRegular Expressions problem
Hi

can anybody help me write a regular expresion for a string like this

"X,Y,Z,A,B,C,Time"

X,Y,Z,A,B,C is a 3 digits number

Time is a double value with anynumber of digits with two decimal places.

Thank you very much - 01-05-2011, 07:25 AMmasijade
Well, where's your attempt at it? See the API docs for Pattern for the symbols available and google for a regex tutorial (does not need to be a Java regex tutorial, simply regex). After you post your attempt we will help you correct it. I would, however, suggest simply using the split method of String.

- 01-05-2011, 07:45 AMJavaHater
- 01-05-2011, 08:05 AMmasijade
Well, the last part definately won't work.

- 01-05-2011, 09:16 AMJavaHater
yes, it won't work ( cos it for OP to find out :) )

- 01-05-2011, 10:32 AMmasijade
The

*entire*thing should have been "for OP to find out", or to at least*attempt*. - 01-05-2011, 10:50 AMJavaHater
- 01-05-2011, 11:12 AMmasijade
IOW "do it for me" facilitator.