Forums > MaxMSP

regexp question

November 20, 2008 | 11:46 am

hi, i


November 20, 2008 | 12:13 pm

http://www.python.org/doc/2.5.2/lib/re-syntax.html

tells all you need. takes some time to understand, though.

good luck!

jrp


November 20, 2008 | 12:14 pm

On 20 Nov 2008, at 11:46, niki wrote:

>

Seat
> 1:

> AEKARAS
> ($93
> in
> chips)
>
> and i want to get "Seat" "1" "AEKARAS"

You’ll need to be more specific – one example doesn’t give enough
information about the format.

But it could be like this:

/copyGreenBold>([:alpha:])+s+([:digit:])+:s*([:upper:]+)/

Possibly with some linebreak-swallowing machinery, bearing in mind
that (i) all regexp implementations are slightly different (I’ve been
using Perl and Java regex more recently than Max) and (ii) my regexp
chops are pretty rusty and (iii) your input syntax isn’t specified; so
consider this a starting point, and do a LOT of testing.

It’s like the old joke: you have a problem, so you come up with a
regexp to solve it. You now have two problems.

Good luck with your gambling application.

– N.

Nick Rothwell / Cassiel.com Limited
http://www.cassiel.com
http://www.myspace.com/cassieldotcom
http://www.last.fm/music/cassiel
http://www.reverbnation.com/cassiel
http://www.linkedin.com/in/cassiel
http://www.loadbang.net


November 20, 2008 | 3:06 pm

This regex parses the example that you gave but without knowing more about the task you want to achieve in general it might not help so much.

It looks for the string "". then it returns any characters up until "


November 20, 2008 | 5:08 pm

thx very much, that worked perfect on the files (it


November 20, 2008 | 5:16 pm

The [regexp] helpfile and documentation aren’t particularly extensive. I’ve found http://www.regular-expressions.info very helpful, especially the tutorials. The mozilla javascript regex page is also quite good. If all else fails I go trial and error bit by bit through the regex checking that it is returning what i expect it to be at each stage and modifying the re: if it isn’t.

lh


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