Regular Expression Tutorial

Download Links
Regexp Tutorial

A Max/MSP tutorial and reference patch that explains a few of the basic techniques you need to create regular expressions for string parsing and pattern matching using the [regexp] and [jit.str.regexp] objects. It contains working examples of the most important and widely used features of regular expressions so that you can explore and learn from them in the Max environment.

The topics covered include:

  • Character Types
  • Anchors
  • The Dot
  • Alternation
  • Repetition
  • References

Additional URLs

Jan 29 2016 | 1:36 am

I want to extract some part from url address using ‘regexp’ or other.
for example, from "×200-product-m-2.png", I want to extract only "m-2". Any solution for this?

Jan 30 2016 | 12:54 pm

Sure, but you gotta ask yourself what assumptions you can make about your input data. For instance, will you only feed your regular expression things that end with .png? Are you only interested in the three characters before the file extension? If so, you could do the following:

-- Pasted Max Patch, click to expand. --

Viewing 2 posts - 1 through 2 (of 2 total)

Explore More

Subscribe to the Cycling ’74 Weekly Newsletter

Let us tell you about notable Max projects, obscure facts, and creative media artists of all kinds.

* indicates required