【发布时间】:2017-05-17 12:12:41
【问题描述】:
我正在使用 Visual Studio 2012 - Web 性能测试工具。
在这里,我有一个这样的引用 URL。 (这大约有 30 行长,但我保持简短)
https://first URL/Second/Third/Fourth/five/SearchResults?json=%7B%22SalesInventoryID%22%3Anull%2C%22BundleInventoryID%22%3Anull%2C%22InventorySalesPriceID%22%3Anull%2C%22SiteType%22 %3A8%2C%22SiteName%22%3A%22Desert%20Club%22%2C%22PointsMin%22%3A1%2C%22PointsMax%22%3A999999%2C%22RoomType%22%3Anull%2C%22PriceMin%22%3A1%2C %22PriceMax%22%3A999999%2C%22SeasonType%22%3Anull%2C%22FrequencyType%22%3Anull%2C%22CheckInType%22%3Anull%2C%22WeekMin%22%3A1%2C%22WeekMax%22%3A52%2C%22RoomMin %22%3A%221%22%2C%22RoomMax%22%3A%22999999%22%2C%22TourID%22%3A2022154%2C%22TourLocationID%22%3A54%2C%22ListResults%22%3Anull%2C%22BundledResults%22 %3Anull%2C%22TourParticipantInfo%22%3A%7B%22TourID%22%3A2022154%2C%22SiteID%22%3A1%2C%22SiteName%22%3Anull%2C%22PersonID%22%3A364182%2C%22FirstName%22%3A %22Lynn%20A.%22%2C%22LastName%22%3A%22McDougald%22%2C%22City%22%3A%22Charlotte%22%2C%22State%22%3A%22-%22%2C%22ShortState%22 %3A%22-%22%2C%22Country%22%3Anull%2C%22CountryID%22%3A840%2C%22OwnerNumber%22%3A%226017104%22%2 C%22OwnerStatus%22%3Anull%2C
搜索结果之后,一切都在不断变化。
谁能告诉我,如果我在“/fourth”之后需要任何东西,我该怎么做
就像我只需要这样 - https://first URL/Second/Third/Fourth/
我试过了:
https://first URL/Second/Third/Fourth/.*
和
https://first URL/Second/Third/Fourth/(.*)
它没有工作。
【问题讨论】:
-
你的正则表达式工作正常,你只需要转义每个
/(改为写\/) -
如果你不想要第一部分,把它放在后面,像这样:
(?<=https:\/\/first URL\/Second\/Third\/Fourth\/)
标签: c# regex visual-studio-2012 performance-testing webtest