Re: How do I get String.split() to do what I want?

From: Phil Hühn (Not_at_valid.net)
Date: 06/30/04

  • Next message: iksrazal: "Re: Is there java telnet-client API to connect telelnet server?"
    Date: Thu, 01 Jul 2004 01:25:29 +1200
    
    

    Phil Hühn wrote:
    > Yu SONG wrote:
    >
    >> is it always in the form of "digit, 'abc', digit"?
    >
    > No, that was just a short example, there may be a varying number of
    > arguments, eg
    >
    > "5,6,7,'oh, joy',15,'yes',3,7,3"
    > or
    > "'hello',97,45,'doe,john','bloggs,fred',3,8"

    Actually, I should say what else I tried. I had a string with 36 fields
    but using regex "," it only extracted 19 fields.

    With regex "\',\'|\d,\'|\',\d" it found 33.
    With regex "\',\'|\d,\'|\',\d|\d,\d" it went back to only 29! Weird.


  • Next message: iksrazal: "Re: Is there java telnet-client API to connect telelnet server?"