locked
How can I get some text from string like AB_CD_9.9.9_Sometext RRS feed

  • Question

  • How Can I get

    only 9.9.9 from  string "AB_CD_9.9.9_Sometext" with powershell and regular expression?

    Thank you,

    Lei

    • Moved by Bill_Stewart Monday, June 30, 2014 7:14 PM Poor quality question/shows no research effort
    Friday, May 2, 2014 4:57 PM

Answers

  • This works.

    if('AB_CD_9.9.9_Sometext' -match '\d\.\d\.\d'){$matches[0]}else{'notfound'}


    ¯\_(ツ)_/¯

    • Proposed as answer by tommymaynard Friday, May 2, 2014 5:06 PM
    • Marked as answer by Just Karl Friday, July 11, 2014 2:43 AM
    Friday, May 2, 2014 5:02 PM