-
Regular expression
I am trying to parse a string with this pattern:
objectA objectId anotherVariable < x y z origin1 origin2>
I don't care about the first portion, I just want to put the data <....> on one string (including the tokens < and >) - how can I do that in a clean way ?
-
Re: Regular expression
What have you tried? Recommended reading: Pattern (Java Platform SE 6)
-
Re: Regular expression
This might help too. Decent for looking up regex stuff.
If you know the format of the line, though, you should ask if you need regex at all. String.split("thingToSplitOn") works very well for this...
-
Re: Regular expression
Um, String#split(...) takes a regex parameter.
db
-
Re: Regular expression
Derp, I knew that last week. In any case, he shouldn't need to use fancy regex for this. I don't believe "<" is a reserved character.