| Author |
Splitting a string
|
anoop kerala
Greenhorn
Joined: Mar 03, 2010
Posts: 10
|
|
Hi,
i want to split a string for example
1) @a.b=@c.d+@e.f;
one output i want is a,c,e which has got prefix '@'
second output i want is is b,d,f which has got prefix '.'
i prefer a solution with regex please..
thanks in advance
lenin
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
Check out java.util.regex.Pattern. It has lots of information on regexes in Java. Especially check out what capturing groups do.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32611
|
|
There is lots more information in the tutorials, eg this one.
|
 |
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
|
posted

0
|
|
Why do you want to use regexes? I'm not convinced that's the easiest solution to this problem.
|
 |
 |
|
|
subject: Splitting a string
|
|
|