Loading ...
Sorry, an error occurred while loading the content.

1256myPatterns: pattern matching in JSON and custom notations

Expand Messages
  • nic.volanschi
    May 11, 2009

      I am pleased to announce you the availability of a novel free library for JavaScript, called myPatterns/JS, implementing pattern matching in JSON and other custom notations.

      With myPatterns/JS, you can match native JavaScript objects with JSON patterns such as:

      "{name:{firstname:%f, lastname:"Smith"}, children:[%elder | %_]}"

      which both checks if an objects matches the pattern and if yes, returns a resulting substitution, such as: {f:"John", elder:{name: "Bob"}}.
      You can use such patterns for filtering data sequences, too.

      Other, customized notations can be defined with a few lines of JavaScript code. No grammar/parser needed.

      You can try the library online at:


      Any feedback is greatly appreciated!