
Security Fundamentals
Turtles, Clams, and Cyber Threat Actors: Shell Usage
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
Interactively highlight regular expression matches.
A TUI application that shows the matches of a (python-flavored) regular expression as you type it.
I really like using RegExr, but it uses the javascript regex engine and there are some subtle differences between the results there and what you get with python.
python3 -m pip install hlre
Run
hlre -f nginx.log
Type a regex and see the matches highlighted in nginx.log
.
Press Control-C
to exit.
You can either highlight matches with the built-in example text, a string passed on the command line, or in an external file.
Built-in Demo Text
hlre --demo-text
String
hlre --text 'This is the regular expression subject.'
External File
hlre --file nginx.log
Reading in the whole file can slow this tool down quite a bit, so you probably want to do something like:
hlre --file <(head -n 10 nginx.log)
To look at just the first 10 lines.
By default, each line is treated as a seperate subject to match the regex on.
To highlight all matches in the subject, use the -a
flag:
hlre --demo-text -a
# OR
hlre --file nginx.log --all
This uses re.finditer
and the re.MULTILINE
flag under the hood.
hlre
uses prompt toolkit's HTML functionality, so any tag name that works
there should work here. This tool does not currently support any custom
attributes on tags (e.g style="..."
).
Here are some examples:
Underline the entire match, highlight capture groups in a dark red
hlre --demo-text --highlight-style u --group-highlight-style firebrick
Highlight the entire match in green, bold the capture groups
hlre --demo-text -s green -g b
Italicize the entire match, highlight capture groups in cyan
hlre --demo-text -s i -g cyan
FAQs
Interactively highlight regular expression matches
We found that hlre demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security Fundamentals
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
Security News
At VulnCon 2025, NIST scrapped its NVD consortium plans, admitted it can't keep up with CVEs, and outlined automation efforts amid a mounting backlog.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.