Visual Studio C++ Standard Regex get tag till whitespace
Visual Studio C++ Standard Regex get tag till whitespace
我有这个字符串:
LOWS 111150Z 38005KT 320V050
我需要 KT 标签 38005KT。KT 标签可以采用以下格式:
- 18010KT
- 35012G20KT
- 00000KT
- VRB16G28KT
我尝试使用以下正则表达式:
regex wind("[^\s].*KT");
但是我得到以下字符串:
LOWS 111150Z 38005KT
我做错了什么?
regex wind( "[0-9a-zA-Z]*KT" );
会给你所需的字符串。
这意味着在KT
之前无限次0-9
和a-z
和A-Z
。
因此,不包括空格和其他所有内容。
相关文章:
- 了解 ELF 可执行SHT_NOTE部分".note.ABI-tag"
- C++ 中的"template <typename From, typename Tag> struct Alias;"是什么?
- C++ 错误 - <unnamed-tag>不允许匿名联合的成员使用 cass 内初始值设定项
- MSBUILD -TAG PropertyGroup具有属性标签,但没有记录
- 如何使用 vim 中的 :tag 命令在 .hpp 和相应的.cpp之间切换
- <tag> 使用 libxml2 从 XML 中获取C++中的值
- 有没有办法修改样式表,以便它将带有空标记的 XML 文档转换为 <tag />?
- 如何从 gdcm::Tag 访问"group, element"字符串
- Visual Studio C++ Standard Regex get tag till whitespace
- 'Tag' boost::p ool_分配器和 boost::fast_pool_allocator 中的模板参数是否支持控制基础池的实例?
- 提升精神:如何将"anything from line till particular word"收集到一个变量中?
- 这是"Tag Dispatching"吗?
- 性能分析"invalid arc tag" (0x00000000)
- 某些软件中是否使用"dog-tag"字段?
- 在c++中,enum [tag] [: type] {enum-list} [declarator]是否合法?
- 在消息反序列化期间,python中的Protobuf抱怨'Unexpected end-group tag.'