Home > Software design >  Need regex to get the version from this output
Need regex to get the version from this output

Time:10-30

Kindly assist me with a regex for the following:

TEXT : /xxx/xxx/xxx/xxxx/abc_2.77.789.46836936_xxxx/xxxx/xxxxxxx

I need a regex to extract the number after abc_ and before the last period (.). Except for the numbers others are constant.

Expected result: 2.77.789

CodePudding user response:

You can use:

abc_([\d.] )\.

Result in 1st Capturing Group $1

https://regex101.com/r/1JIops/1

  • Related