What data format is this?

I have a bunch of data files like this:

("String" :tag1 (value) :tag2 (value2) :tag3 ( :nested_tag1 (foo) :nested_tag2 ( :nested2_tag1 ( : ( nested3_tag1 :baz (true) :qux ("a really long block of text") ) ) ) ) ) 

This is just a small example. Real files have many thousands of lines.

Forgive my ignorance, but I do not understand the format. Is this a common or well-known format? Does he have a name?

I want to process it using Perl and I thought if there were any external modules that would allow me to easily turn it into a Perl data structure - without having to write Parser itself. In the end, why reinvent the wheel !; -)

+6
source share
1 answer

For me it looks like a Lisp -ish S-Expression . For example, Emacs understands your example very well after quoting it as a list.

S-expressions are usually very easy to parse, but also searching for CPAN for S-expressions should give you enough to not write your own parser.

+7
source

Source: https://habr.com/ru/post/885912/