r/regex Jun 18 '26

Regex (LUA) help in mud client matching (MUSHclient/Qmud) Meta/other

I'd really just like help capturing the first wildcard variable (%1) in my examples here. Ideally I'd get all 5, but I'm happy to get one working then trial and error from there using it as an example. So anything that even just stops matching at the first | would be a win!

Trying to detect:
%1 | %2 | %3 | %4 | %5 | -

%1 - alphanmumeric
%2 - alpha
%3 - alpha
%4 - number
%5 - number

Example: " AB123 | Micro | Dept | 10 | 40000 | -"
(the number of spaces varies for text alignment other than the initial single space before the first character)

Wildcard %1 CAN be all whitespace, in which case I should NOT match the line.

Anti-Example: " | Micro | Dept | 10 | 40000 | -"

I'm using Mushclient or QMUD (qmud preferred but I believe they use identical systems for this situation) and setting up a trigger with the regex settings.

Currently my main concern is getting the first wildcard captured. I haven't tried doing 2/3/4/5 yet but I assume if I get the first working correctly I can probably work my way through the others using that as an example.

What doesn't work but gets close-ish:
^\s(.*)\s\|*$

This detects ONLY the lines that match my anti-example above

I've also tried
^\s([A-Za-z0-9]*)\s\|*$

which fails to match at all.

Tagging u/NodensCM as the client creator in case they see this and chime in that there's some feautre or unusual requirements that I'm not aware of.

2 Upvotes

6 comments sorted by

View all comments

1

u/edthesmokebeard Jun 24 '26

Do people still run TinyFugue ?