preg_match type split

Discussion in 'Javascript' started by Paul Lautman, Mar 4, 2007.

  1. Paul Lautman

    Paul Lautman Guest

    I have the following string in a variable:

    '\074a href="" onClick="pl_go(64);return false;">James T Kirk\074/a>',
    '\074a href="" onClick="pl_go(64);return false;">thecaptain\074/a>',
    '\074a href="" onClick="pl_go(64);return
    false;">\074/a>'

    (there are 3 newlines in there).
    Is there a simple (possibly regex?) way to split this out to an array to end
    up like:

    elem[0] = 64
    elem[1] = 'James T Kirk'
    elem[2] = 'thecaptain'
    elem[3]= ''

    TIA
     
    Paul Lautman, Mar 4, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    480
  2. Carlos Ribeiro
    Replies:
    11
    Views:
    720
    Alex Martelli
    Sep 17, 2004
  3. trans.  (T. Onoma)

    split on '' (and another for split -1)

    trans. (T. Onoma), Dec 27, 2004, in forum: Ruby
    Replies:
    10
    Views:
    227
    Florian Gross
    Dec 28, 2004
  4. Sam Kong
    Replies:
    5
    Views:
    261
    Rick DeNatale
    Aug 12, 2006
  5. Captain Paralytic

    preg_match type split

    Captain Paralytic, Mar 5, 2007, in forum: Javascript
    Replies:
    3
    Views:
    118
    Captain Paralytic
    Mar 5, 2007
Loading...

Share This Page