regexp: match | no match separation (SOLVED)

Peter Ostry's icon

I get strings like this:
<1>
<12>
<2513>
they match my criterion.
Anything else than <number> does not match.

I need a clear distinction between ‘match’ and ‘no match’.

I tried [regexp ^\\<\\d+\\>$], but unfortunately unmatched strings produce something at both outputs 3 & 4. This is impractical, I only want something at one output at a time. I have therefore added separation via a gate, which looks pretty dodgy and I don't want to keep it like this:

I don't really care what comes out, it can also be converted or 0/1, I just want to recognise for sure whether it is a match or not.

How can I do this with a better method?


Peter Ostry's icon

Problem is solved in a different way (no regexp).

TFL's icon

Using the simpler regexp \\<\\d+\\> it seems to work as intended:

Max Patch
Copy patch and select New From Clipboard in Max.

Peter Ostry's icon

Yes and it seems to work with the ^…$ version also.

The real problem was somewhere else: regexp was receiving several messages in a row, which just happened to be in a certain order. This was not allowed anyway and I now separate the messages in an earlier stage of the process.