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

Search regex should be more intuitive #17

Open
longpaul opened this issue Jan 26, 2018 · 0 comments
Open

Search regex should be more intuitive #17

longpaul opened this issue Jan 26, 2018 · 0 comments

Comments

@longpaul
Copy link

longpaul commented Jan 26, 2018

Example:
zabbixctl -Tp -xx /mo

[DEBUG] ** searching m.*o

It grabs /home/kovetskiy for example... Not really useful.

I did a little hack in the code to get rid of it (src/github.com/kovetskiy/zabbixctl/search.go)

import (
        "regexp"
        "strings"
        "bytes"
)
...
    pattern := strings.Join(letters, "")

    list := []string{".*", pattern ,".*"}

    var str bytes.Buffer

    for _, l := range list {
            str.WriteString(l)
            }
    pattern = str.String()

You can use it, if you want

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant