Reputation: 2777
I have a string "<wpf><xaml><wpf-controls>"
.
I need the string between the tags in array format.
How do I get this?
Upvotes: 0
Views: 747
Reputation: 4532
The regex for this problem is really simple it is: /<(.*?)>/
For the array part is would reference to the answer on how to use one line regular expression to get matched content
EDIT:
for array of the insides of the tags use <wpf><xaml><wpf-controls>".scan(/(?:<(.*?)>)*/)
The (?: .. )
groups the tag together and the *
says we want 0 or more of that group :)
Upvotes: 2