Hey, does anybody know how to filter out logcat me...
# announcements
l
Hey, does anybody know how to filter out logcat messages that match regex
\d{3}\.\d{10},
? Negative lookup
(?!\d{3}\.\d{10},)
doesn’t seem to work here for some reason. The example message looks like this
2019-06-25 13:45:22.286 13313-13351/com.secretproject.alpha I/Http Response: │       247.2145208724,
Filtering out based on TAG is not a feasible solution, because I need this to log out other responses.
d
Did you try
.*
in front of the negative look ahead?
r
neither of those are correct, that's not how lookaheads work
(?!\d{3}\.\d{10},)
matches all strings, because you're looking for a string that contains a blank string that is followed by a number in that format
which is...everything. it'll just match a blank string somewhere in the string
Is the number at the end of the string? if so, assuming that Studio actually supports lookbehinds, you could do something like
(?<!\d{3}\.\d{10},)$
disclaimer: I didn't test that
but that would be "the end of the line, assuming it's not preceded by something matching `\d{3}\.\d{10},`"
d
Right so you need to have
^.*?(NL)$
where NL is the negative lookahead
r
that would also work, but only if it's at the end of the string
d
I reckon you dont need negative lookahead at all
Doesnt matter whether the number thing is in the matched text
r
honestly though your best bet is probably to do this from the command line and then use
grep -v
or something
l
thanks for the help guys!