# Help with String to Array (maybe regEx?)

**URL:** <https://forum.kirupa.com/t/help-with-string-to-array-maybe-regex/324902>\
**Category:** flash\
**Created:** [September 14, 2011, 8:45pm UTC](https://forum.kirupa.com/t/help-with-string-to-array-maybe-regex/324902 "2011-09-14T20:45:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kill\_robot\_kill](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kill_robot_kill/32/359_2.png) [@kill\_robot\_kill](https://forum.kirupa.com/u/kill_robot_kill)\
**Post date:** [September 14, 2011, 8:45pm UTC](https://forum.kirupa.com/t/help-with-string-to-array-maybe-regex/324902/1 "2011-09-14T20:45:22Z")

</div>

I need some help figuring out how to create an array from a string.  
The string will look something like this:

```auto

Main Idea
-Idea 1
--Idea 1 sub point 1
-Idea 2
--Idea 2 sub point 1
---Idea 2 sub point 1 subsub 1
---Idea 2 sub point 1 subsub 2
--Idea 2 sub point 2
-Idea 3

```

Each “-” indicates a child relationship or ‘Sub’. Each child can have any number of children which can have any number of children.

thanks!
