Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What format is expected by pacman in its regular expression?

command: sudo pacman -Ss *workbench
result: error: search failed: invalid regular expression

command: sudo pacman -Ss workbench*
result:
result

Is this expected or have I got the initial command wrong?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The star * is a quantifier in regular expressions. That means it governs how often to repeat what comes before it.

You can’t write *workbench because there is nothing before the *. (You’re probably thinking of shell patterns, which are not regular expressions.)

But you can write workbench*, which would match "workbench" and "workbenchhhhhhhh", and "workbenc" (!).

Overall you don’t need the star here at all. The expression workbench will match in the middle of the string without it.

sudo pacman -Ss workbench
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading