regex - How to parse some text from file in Perl -


hello want parse file structure this... after name: {} can other things same form. something: {}.

---  names:    first_thing: {}    second_thing: {}    name: {} 

thanks answers.

i want parse form

first_thing second_thing name 

perl -ne 'print "$1\n" if /^\s+ (\w+)/x' file 

on windows:

perl -ne "print qq{$1\n} if /^\s+ (\w+)/x" file 

Comments