How To Install re2 on Fedora 34

re2 is C++ fast alternative to backtracking RE engines C++ fast alternative to backtracking RE engines

Introduction

In this tutorial we learn how to install re2 on Fedora 34.

What is re2

RE2 is a C++ library providing a fast, safe, thread-friendly alternative to backtracking regular expression engines like those used in PCRE, Perl, and Python. Backtracking engines are typically full of features and convenient syntactic sugar but can be forced into taking exponential amounts of time on even small inputs. In contrast, RE2 uses automata theory to guarantee that regular expression searches run in time linear in the size of the input, at the expense of some missing features (e.g back references and generalized assertions). re2 1 20190801 8.fc34 x86_64 159 k re2-20190801-8.fc34.src.rpm fedora C++ fast alternative to backtracking RE engines http BSD RE2 is a C++ library providing a fast, safe, thread-friendly alternative to backtracking regular expression engines like those used in PCRE, Perl, and Python. Backtracking engines are typically full of features and convenient syntactic sugar but can be forced into taking exponential amounts of time on even small inputs. In contrast, RE2 uses automata theory to guarantee that regular expression searches run in time linear in the size of the input, at the expense of some missing features (e.g back references and generalized assertions).

We can use yum or dnf to install re2 on Fedora 34. In this tutorial we discuss both methods but you only need to choose one of method to install re2.

Install re2 on Fedora 34 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install re2 using dnf by running the following command:

sudo dnf -y install re2

Install re2 on Fedora 34 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install re2 using yum by running the following command:

sudo yum -y install re2

How To Uninstall re2 on Fedora 34

To uninstall only the re2 package we can use the following command:

sudo dnf remove re2

re2 Package Contents on Fedora 34

/usr/lib/.build-id
/usr/lib/.build-id/39
/usr/lib/.build-id/39/12a93805d9debc879d70fe8fd2a2fcd87b4894
/usr/lib/libre2.so.0a
/usr/lib/libre2.so.0a.0.0
/usr/share/doc/re2
/usr/share/doc/re2/AUTHORS
/usr/share/doc/re2/CONTRIBUTORS
/usr/share/doc/re2/README
/usr/share/licenses/re2
/usr/share/licenses/re2/LICENSE
/usr/lib/.build-id
/usr/lib/.build-id/cf
/usr/lib/.build-id/cf/9045d93414c025719dd2c7d6eaf3200f3bf841
/usr/lib64/libre2.so.0a
/usr/lib64/libre2.so.0a.0.0
/usr/share/doc/re2
/usr/share/doc/re2/AUTHORS
/usr/share/doc/re2/CONTRIBUTORS
/usr/share/doc/re2/README
/usr/share/licenses/re2
/usr/share/licenses/re2/LICENSE

References

Summary

In this tutorial we learn how to install re2 on Fedora 34 using yum and dnf.