lundi 25 janvier 2016

Regex pattern issue c#

I have a little trouble here. I am trying to find a Regex which will match all fallowing examples:

  • Method( "Team Details" )

    Should return: Team Details

  • Method( @"Team details item

    and more

    and More" )

    Should return: Team Details item and more and more

  • Method( "Team \"Details\"" )

    Should return: Team "Details"

  • Method( @"Team ""Details""" )

    Should return: Team "Details"

  • Method( @"Team

    ""Details""" )

    Should return: Team

    "Details"

I managed to create a regex pattern:

Method\(.*\"(.*)\".*\)

whcih is working in the first example and partially second one, but I found it very difficult to create one pattern for all 5 examples. Any help ?

Cheers

Aucun commentaire:

Enregistrer un commentaire