Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
^Hit((?!(\r?\n))\s)http[s]?\:\/\/(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+((?!(\r?\n))\s|\/)((\w+(\-|((?!(\r?\n))\s)|\/|\.|\(\r?\n)?))*
/
gm

Description

Screen print during an apt-update and install will generate a lot of data we don't need. This regex is used in your text editor to remove the HIT Url package information.

Submitted by anonymous - 9 years ago