regexp question

niki's icon

hi, i

jayrope's icon

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

good luck!

jrp

nick rothwell | project cassiel's icon

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
www.cassiel.com
www.myspace.com/cassieldotcom
www.last.fm/music/cassiel
www.reverbnation.com/cassiel
www.linkedin.com/in/cassiel
www.loadbang.net

Luke Hall's icon

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 "

niki's icon

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

Luke Hall's icon

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