Skip to content

Conversation

@per1234
Copy link
Contributor

@per1234 per1234 commented Nov 2, 2025

The installation script scrapes the GitHub releases page for the version number of the latest release. A regular expression is used to extract the version number from the title.

Previously, the regular expression would return a corrupted version number if the name of the repository owner or repository contained numbers. For example, if used in a repository owned by GitHub user per1234, where the latest release version was 1.2.3, it would return the following version number:

1.2.3
1234

…syntax

A script is provided to facilitate installation of Arduino Lint.

The grep utility is used for several purposes in the script.

grep supports multiple flavors of regular expression syntax:

* "basic" (BRE)
* "extended" (ERE)
* "perl" (PCRE)

The default "BRE" syntax is inconsistent with the syntax used in all other common regular expression applications:

> In basic regular expressions the meta-characters ?, +, {, |, (, and ) lose their special meaning; instead use the
> backslashed versions \?, \+, \{, \|, \(, and \).

The "PCRE" syntax that would otherwise be preferred is not available when using grep on BSD/macOS machines.

So grep should be configured to use the "ERE" in scripts that are intended to be cross-platform (as is the case with
this script).
The installation script scrapes the GitHub releases page for the version number of the latest release. A regular
expression is used to extract the version number from the title.

Previously, the regular expression would return a corrupted version number if the name of the repository owner or
repository contained numbers. For example, if used in a repository owned by GitHub user `per1234`, where the latest
release version was 1.2.3, it would return the following version number:

```
1.2.3
1234
```
@per1234 per1234 self-assigned this Nov 2, 2025
@per1234 per1234 added topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project labels Nov 2, 2025
@per1234 per1234 merged commit 949619f into arduino:main Nov 2, 2025
22 checks passed
@per1234 per1234 deleted the fix-regex branch November 2, 2025 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant