Skip to content

Notify space after regex $ #4525

@Kebap

Description

@Kebap

Brief summary of issue / Description of requested feature:

excess whitespace after regex "line end" character breaks patterns invisibly

Steps to reproduce the issue / Reasons for adding feature:

  1. player asked in Discord, why does alias not work
  2. player suspected pattern wrong, because command wasn't recognized, but sent to game instead
  3. building the same alias anew with same pattern worked fine indeed
  4. nobody noticed there was an excess space character after the original pattern (besides demonnic who assumed such)

Error output / Expected result of feature

activate alias with excess whitespace, but show hint above "did you really want to do that?"

Extra information, such as Mudlet version, operating system and ideas for how to solve / implement:

same goes for triggers, etc. all places with regex and not only alias like this example.

excess space can sometimes happen unintentionally when copy/pasting..

example alias:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MudletPackage>
<MudletPackage version="1.001">
    <AliasPackage>
        <Alias isActive="yes" isFolder="no">
            <name>Wavecall Distance</name>
            <script>send("invoke wavecall " .. matches[2] .. " " .. matches[3])

--I want to type wcn5 and have it send "invoke wavecall n 5"</script>
            <command></command>
            <packageName></packageName>
            <regex>^wc(\w+)(\d+)$ </regex>
        </Alias>
    </AliasPackage>
</MudletPackage>

Can't be recognized in screenshot:
image

Workaround: click at the end of pattern line and "mark all" (Ctrl+A):
image

You could then see there is too much white space, should be like this instead:
image

Or just have people copy/paste their alias in chat for comparison

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions