
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Abnormal expressions (abnex) is an alternative to regular expressions (regex). This is a Python library but the abnex syntax could be ported to other languages.
Regex
([\w\._-]+)@([\w\.]+)
Abnex
{[w"._-"]1++}"@"{[w"."]1++}
Abnex (spaced)
{[w "._-"]1++} "@" {[w "."]1++}
Abnex (expanded)
{
[w "._-"]1++
}
"@"
{
[w "."]1++
}
{{{[a-z '_']1++} {[a-z 0-9 '_-.']0++}} '@' {{[a-z 0-9]1++} '.' {[a-z 0-9]1++} {[a-z 0-9 '-_.']0++}} {[a-z 0-9]1++}}
.
!
for not, {}
for groups, 1++
, 0++
, 0+
for: one or more, zero or more, zero or one.[\w-]+@[\w-_]+
[w "-"]1++ "@" [w "-"]1++
^
-> ->
$
-> <-
\A
-> s>
\Z
-> <s
\b
-> :
\B
-> !:
\<
-> w>
\>
-> <w
\c
-> c
\s
-> _
\S
-> !_
\d
-> d
\D
-> !d
\w
-> w
\W
-> !w
\x
-> x
\o
-> o
*
-> 0++
+
-> 1++
?
-> 0+
.
-> *
a|b
-> "a"|"b"
(...)
-> {...}
(?:...)
-> {#...}
[abc]
-> ['abc']
or ["a" "b" "c"]
[^...]
-> [!...]
[a-q]
-> [a-z]
[A-Q]
-> [A-Q]
[0-7]
-> [0-7]
What is the recommended way to write abnexes
[w "_-"]
[w"_-"]
["abc"]
["a" "b" "c"]
, especially incorrect: ["a""b""c"]
{w} "." {w}
{w}"."{w}
Match for an email address:
[\w-\._]+@[\w-\.]+
{[w "-._"]1++} "@" {[w "-."]1++}
{[w"-._"]1++}"@"{[w"-."]1++}
Abnex has most functions from the re
library, but it also has som extra functionality like: last()
& contains()
.
match()
-> match()
findall()
-> all()
split()
-> split()
sub()
-> replace()
subn()
-> replace_count()
search()
-> first()
holds()
: whether or not a string matches an expression (bool).contains()
: wheter or not a string contains a match (bool).last()
: the last match in a string.FAQs
Abnormal expressions (abnex) is an alternative to regular expressions (regex).
We found that abnex 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.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.