使用带有字符串定界符的boost :: tokenizer [英] Using boost::tokenizer with string delimiters

查看:91
本文介绍了使用带有字符串定界符的boost :: tokenizer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找boost :: tokenizer,我发现该文档非常薄.是否有可能使它标记化一个字符串,例如海豚-猴子-狒狒",并使每个单词成为一个标记,以及使每个双破折号成为一个标记?从示例中,我仅看到允许使用单个字符定界符.库是否不够先进,无法使用更复杂的定界符?

I've been looking boost::tokenizer, and I've found that the documentation is very thin. Is it possible to make it tokenize a string such as "dolphin--monkey--baboon" and make every word a token, as well as every double dash a token? From the examples I've only seen single character delimiters being allowed. Is the library not advanced enough for more complicated delimiters?

推荐答案

您似乎需要编写自己的

It looks like you will need to write your own TokenizerFunction to do what you want.

这篇关于使用带有字符串定界符的boost :: tokenizer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆