我无法找到 reg-exp 来查找 txt 文件中的项目(下面以粗体斜体标记)
------------------------------------------------------------------------------------- Suds ( https://fedorahosted.org/suds/ ) version: 0.3.9 (beta) build: R658-20100210
Service ( ndfdXML ) tns="http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl" Prefixes (2)
ns0 = "http://schemas.xmlsoap.org/soap/encoding/"
ns1 = "http://www.weather.gov/forecasts/xml/DWMLgen/schema/DWML.xsd" Ports (1):
(ndfdXMLPort)
Methods (12):
***CornerPoints***(ns1:sectorType sector, )
***GmlLatLonList***(ns1:listLatLonType listLatLon, xs:dateTime requestedTime, ns1:featureTypeType featureType, ns1:weatherParametersType weatherParameters, )
***GmlTimeSeries***(ns1:listLatLonType listLatLon, xs:dateTime startTime, xs:dateTime endTime, ns1:compTypeType compType, ns1:featureTypeType featureType, xs:string propertyName, )
***LatLonListCityNames***(ns1:displayLevelType displayLevel, )
***LatLonListLine***(xs:decimal endPoint1Lat, xs:decimal endPoint1Lon, xs:decimal endPoint2Lat, xs:decimal endPoint2Lon, )
***LatLonListSquare***(xs:decimal centerPointLat, xs:decimal centerPointLon, xs:decimal distanceLat, xs:decimal distanceLon, xs:decimal resolution, )
***LatLonListSubgrid***(xs:decimal lowerLeftLatitude, xs:decimal lowerLeftLongitude, xs:decimal upperRightLatitude, xs:decimal upperRightLongitude, xs:decimal resolution, )
***LatLonListZipCode***(ns1:zipCodeListType zipCodeList, )
**NDFDgen**(xs:decimal latitude, xs:decimal longitude, ns1:productType product, xs:dateTime startTime, xs:dateTime endTime, ns1:weatherParametersType weatherParameters, )
***NDFDgenByDay***(xs:decimal latitude, xs:decimal longitude, xs:date startDate, xs:integer numDays, ns1:formatType format, )
***NDFDgenByDayLatLonList***(ns1:listLatLonType listLatLon, xs:date startDate, xs:integer numDays, ns1:formatType format, )
***NDFDgenLatLonList***(ns1:listLatLonType listLatLon, ns1:productType product, xs:dateTime startTime, xs:dateTime endTime, ns1:weatherParametersType weatherParameters, )
Types (60):
ns0:Array
ns0:ENTITIES
ns0:ENTITY
ns0:ID
ns0:IDREF
ns0:IDREFS
ns0:NCName
ns0:NMTOKEN
ns0:NMTOKENS
ns0:NOTATION
ns0:Name
ns0:QName
ns0:Struct
ns0:anyURI
ns0:arrayCoordinate
ns0:base64
ns0:base64Binary
ns0:boolean
ns0:byte
ns1:compTypeType
ns0:date
ns0:dateTime
ns0:decimal
ns1:displayLevelType
ns0:double
ns0:duration
ns1:featureTypeType
ns0:float
ns1:formatType
ns0:gDay
ns0:gMonth
ns0:gMonthDay
ns0:gYear
ns0:gYearMonth
ns0:hexBinary
ns0:int
ns0:integer
ns0:language
ns1:latLonPairType
ns1:listCityNamesType
ns1:listLatLonType
ns0:long
ns0:negativeInteger
ns0:nonNegativeInteger
ns0:nonPositiveInteger
ns0:normalizedString
ns0:positiveInteger
ns1:productType
ns1:sectorType
ns0:short
ns0:string
ns0:time
ns0:token
ns0:unsignedByte
ns0:unsignedInt
ns0:unsignedLong
ns0:unsignedShort
ns1:weatherParametersType
ns1:zipCodeListType
ns1:zipCodeType
-------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------- Suds ( https://fedorahosted.org/suds/ ) version: 0.3.9 (beta) build: R658-20100210
Service ( ndfdXML ) tns="http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl" Prefixes (2)
ns0 = "http://schemas.xmlsoap.org/soap/encoding/"
ns1 = "http://www.weather.gov/forecasts/xml/DWMLgen/schema/DWML.xsd" Ports (1):
(ndfdXMLPort)
Methods (12):
***CornerPoints***(ns1:sectorType sector, )
***GmlLatLonList***(ns1:listLatLonType listLatLon, xs:dateTime requestedTime, ns1:featureTypeType featureType, ns1:weatherParametersType weatherParameters, )
***GmlTimeSeries***(ns1:listLatLonType listLatLon, xs:dateTime startTime, xs:dateTime endTime, ns1:compTypeType compType, ns1:featureTypeType featureType, xs:string propertyName, )
***LatLonListCityNames***(ns1:displayLevelType displayLevel, )
***LatLonListLine***(xs:decimal endPoint1Lat, xs:decimal endPoint1Lon, xs:decimal endPoint2Lat, xs:decimal endPoint2Lon, )
***LatLonListSquare***(xs:decimal centerPointLat, xs:decimal centerPointLon, xs:decimal distanceLat, xs:decimal distanceLon, xs:decimal resolution, )
***LatLonListSubgrid***(xs:decimal lowerLeftLatitude, xs:decimal lowerLeftLongitude, xs:decimal upperRightLatitude, xs:decimal upperRightLongitude, xs:decimal resolution, )
***LatLonListZipCode***(ns1:zipCodeListType zipCodeList, )
**NDFDgen**(xs:decimal latitude, xs:decimal longitude, ns1:productType product, xs:dateTime startTime, xs:dateTime endTime, ns1:weatherParametersType weatherParameters, )
***NDFDgenByDay***(xs:decimal latitude, xs:decimal longitude, xs:date startDate, xs:integer numDays, ns1:formatType format, )
***NDFDgenByDayLatLonList***(ns1:listLatLonType listLatLon, xs:date startDate, xs:integer numDays, ns1:formatType format, )
***NDFDgenLatLonList***(ns1:listLatLonType listLatLon, ns1:productType product, xs:dateTime startTime, xs:dateTime endTime, ns1:weatherParametersType weatherParameters, )
Types (60):
ns0:Array
ns0:ENTITIES
ns0:ENTITY
ns0:ID
ns0:IDREF
ns0:IDREFS
ns0:NCName
ns0:NMTOKEN
ns0:NMTOKENS
ns0:NOTATION
ns0:Name
ns0:QName
ns0:Struct
ns0:anyURI
ns0:arrayCoordinate
ns0:base64
ns0:base64Binary
ns0:boolean
ns0:byte
ns1:compTypeType
ns0:date
ns0:dateTime
ns0:decimal
ns1:displayLevelType
ns0:double
ns0:duration
ns1:featureTypeType
ns0:float
ns1:formatType
ns0:gDay
ns0:gMonth
ns0:gMonthDay
ns0:gYear
ns0:gYearMonth
ns0:hexBinary
ns0:int
ns0:integer
ns0:language
ns1:latLonPairType
ns1:listCityNamesType
ns1:listLatLonType
ns0:long
ns0:negativeInteger
ns0:nonNegativeInteger
ns0:nonPositiveInteger
ns0:normalizedString
ns0:positiveInteger
ns1:productType
ns1:sectorType
ns0:short
ns0:string
ns0:time
ns0:token
ns0:unsignedByte
ns0:unsignedInt
ns0:unsignedLong
ns0:unsignedShort
ns1:weatherParametersType
ns1:zipCodeListType
ns1:zipCodeType
-------------------------------------------------------------------------------------------
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您想要一个可以找到所有这些的正则表达式,还是每个都可以找到一个?你需要返回什么数据(我假设是 () 的内容和对象名称)?
从你所拥有的猜测,我假设这样的事情可以工作:
它将匹配前半部分中的一个名称,然后是它后面的一个
(data)
组(你可能想让它成为非-贪婪的)。如果您编辑问题或评论以提供更多信息,我将编辑答案。
Do you want a regex that finds all of them, or one for each? What data do you need back (I assume the contents of the () and object name)?
Guessing from what you have, I assume something like this could work:
That will match one of the names in the first half, then a
(data)
group after it (you may want to make it non-greedy).If you edit the question or comment with more info, I'll edit the answer.
@peachykeen:是的,它必须是非贪婪的,否则 .* 会一直竞争到字符串中的最后一个 ')' 。您还需要匹配组,最好是命名的,以便引用您匹配的内容:
@peachykeen: yes it needs to be non greedy,otherwise the .* races all the way to the very last ')' in the string. You also need match groups, preferably named, in order to refer to what you matched: