Following are the contents of the config file
{
"Line1": true,
"Line2": "\/\/{hostname}\/",
"version": "2.8.9",
"Line4": true,
"Line5": true
}
I am using Linux, and I need to find semantic version number 2.8.9 above and store in one variable and replace it with either major, minor or patch version based on the logic in the next variable.
Can someone please suggest the appropriate sed regex expression for both finding and replacing the semantic version
These are 2 valid regex expressions for semantic versions
^([0-9]+\.){2,2}(\*|[0-9]+)(\-.*){0,1}$^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$