Skip to content

Conversation

@theory
Copy link
Owner

@theory theory commented Sep 5, 2025

This prevented the ${major%.*} -ge 17 lines from working. I wasn't able to get a single regex to work with Bash 3.2.57, so just added a second replacement line.

@fluca1978
Copy link
Collaborator

Sorry for late replying, I was away from my keyboard.

Does using sed seem to be a good option?
major=$(echo $v | sed 's/\([0-9][0-9]\)\(beta\|rc\)[0-9]/\1/' )

Another ugly trick, could be this:
major=${v//[[:alpha:]]*[0-9]/}

and it's ugly because it is tripping of everything with text, not just beta and rc.

@theory what do you prefer?

@theory
Copy link
Owner Author

theory commented Sep 19, 2025

Aaaah, I had tried major=${v//[[:alpha:]]+[0-9]/} but it didn't work. Interesting that major=${v//[[:alpha:]]*[0-9]/} does (only change: * instead of +). I'm totally fine with it. What do you prefer?

@fluca1978 fluca1978 closed this in f8e6754 Sep 21, 2025
@fluca1978
Copy link
Collaborator

Aaaah, I had tried major=${v//[[:alpha:]]+[0-9]/} but it didn't work. Interesting that major=${v//[[:alpha:]]*[0-9]/} does (only change: * instead of +). I'm totally fine with it. What do you prefer?

Yesh, I forgot to mention that * is not working as we would expect in regular expressions. This is the time I miss Perl the most!

@theory theory deleted the handle-rc branch September 25, 2025 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants