Parse a version
FreeLogic@rabbinatix/parse-a-version by Rabbinatixupdated Oct 4, 2026
Reads `v1.4.2` as major 1, minor 4, patch 2.
A regular expression with groups checks the format and captures the three numbers; Get Item picks each group and To Number converts it.
Shows: Regex Match with groups, Get Item, To Number.
How to use it
Add it to your logic, then add a Call Function step in any logic and pick Parse version. It belongs to no system, so every system can use it. Or download the TypeScript and call it from your own code.
Inputs
version: Text
Outputs
valid: Yes / No
major: Number
minor: Number
patch: Number
Previewdrag the steps around; scroll to zoom
Function Entry, Input / output. 0 inputs, 2 outputs. step 1 of 9
Parse version
version
Regex Match, String. 1 input, 2 outputs. step 2 of 9
Regex Match
text
matches
groups
Get Item, Collection. 2 inputs, 1 output. step 3 of 9
Get Item
array
index
item
Get Item, Collection. 2 inputs, 1 output. step 5 of 9
Get Item
array
index
item
Get Item, Collection. 2 inputs, 1 output. step 7 of 9
Get Item
array
index
item
To Number, Data. 1 input, 2 outputs. step 4 of 9
To Number
value
result
valid
To Number, Data. 1 input, 2 outputs. step 6 of 9
To Number
value
result
valid
To Number, Data. 1 input, 2 outputs. step 8 of 9
To Number
value
result
valid
Return, Input / output. 5 inputs, 0 outputs. step 9 of 9
Return
valid
major
minor
patch
Arrow keys: next or previous step in flow order. Alt with arrows: nearest step in that direction. Enter: open. Shift F10: more actions.
Examplesrun live against the logic · 2/2 pass
| Passed | Example | Input | Output |
|---|---|---|---|
| With a v | {"version":"v1.4.2"} | {"valid":true,"major":1,"minor":4,"patch":2} | |
| Not a version | {"version":"1.4"} | {"valid":false,"major":0,"minor":0,"patch":0} |
Try it
Versions
In this package
Parse version (entry)
