Getting contents of square brackets with regex, including nested ones

Posted by peroyomas on Stack Overflow See other posts from Stack Overflow or by peroyomas
Published on 2010-04-05T18:40:31Z Indexed on 2010/04/05 18:43 UTC
Read the original article Hit count: 143

Filed under:

Is there any way to have this:

[one[two]][three]

And extract this with a regex?

Array (
    [0] => one[two]
    [1] => two
    [2] => three

© Stack Overflow or respective owner

Related posts about regex