New to Fedora, (just installed it) and a slow learner.
try to install pcre with dnf
“Package pcre2-10.42-1.fc39.2.x86_64 is already installed.”
issue terminal command “which pcre2”
/usr/bin/which: no pcre2 in (/root/.local/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/var/lib/snapd/snap/bin)
Also, you can enable Perl-compatible regular expressions (PCREs) for grep with -P option. You can use it without needing to install additional packages:
Apparently you were logged in as root when you ran that command. The directories /root/.local/bin and /root/bin should never be seen in any commands when running as your regular user.
For security and to prevent damage to the system by inadvertent commands please log out of the root environment and use sudo for your admin tasks and your regular user for day to day use.