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

regex doesn't work #55

Open
PaulPuschmann opened this issue Mar 8, 2023 · 0 comments
Open

regex doesn't work #55

PaulPuschmann opened this issue Mar 8, 2023 · 0 comments

Comments

@PaulPuschmann
Copy link

I tried to start my first analysis....
panic: runtime error: index out of range [0] with length 0

image

I found the problem in extparser.go

in function parseFileLine() is a regex query

my variables look like this:
line: 2 drwxr-xr-x root root 1024 6-May-2020 18:31 .
e.fileinfoReg: ^\s*(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+-\w+-\d+)\s+(\d+:\d+)\s+([\S ]+)

Command: res := e.fileinfoReg.FindAllStringSubmatch(line, -1)
Result of the command: res = []

The next step is to try to access res:
size, _ := strconv.Atoi(res[0][5])
This query throws the error that you see in the main program

The question is: what is the goal of the regex query and how can I modify it to make it work?

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

No branches or pull requests

1 participant