Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow regex capture tokens in command line for alias #4848

Open
Brickcaster opened this issue Feb 22, 2021 · 4 comments
Open

Allow regex capture tokens in command line for alias #4848

Brickcaster opened this issue Feb 22, 2021 · 4 comments
Labels

Comments

@Brickcaster
Copy link

Brief summary of issue / Description of requested feature:

Capture text in pattern via (.*) or whatever desired pattern.
Regurgitate it in command via $1 or whichever captured group it was.

Steps to reproduce the issue / Reasons for adding feature:

  1. This simplifies many aliases to be regex-only, instead of regex + lua.
@vadi2
Copy link
Member

vadi2 commented Feb 22, 2021

What about using send("mycommand f{matches[2]}") in Lua, would that work?

Reason I say is while this would be good for experienced MUD veterans from other clients, but for anyone coming in new to Mudlet (what we're actually aiming at) it'll be confusing between the Command which can do some sort of (but not really) logic and the actual Lua code box. Right now the line between them is pretty clear, either you have as-is text or Lua for anything more.

@demonnic
Copy link
Member

just a note, it would be send(f"mycommand {matches[2]}") or send(f("mycommand {matches[2]}"))

@Brickcaster
Copy link
Author

Regex capture tokens are a relatively common feature of regex implementations. It would be more natural for anyone with experience with regex to follow this behavior.

Additionally, this is intended to be an alternative workflow, not a replacement to existing methods. Both regex only and regex + lua methods could be supported

@vadi2
Copy link
Member

vadi2 commented Feb 23, 2022

That's a fair way to look at it 👍

@vadi2 vadi2 added the wishlist label Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants