boostorg / boostorg/algorithm

boost::algorithm::split_regex doesn't work with boost::u32regex.

Open
#79 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
131
Forks
117
PR merge metrics
No merged PRs in 30d

Description

I want to split a UTF-8 string into tokens. However it looks like that **split_regex()** failed and just return original string. I also tried `u32regex_replace()` and it indeed replaced successfully.

src.cpp:
```
// CutWord.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include
#include
#include

#include
#include
#include
#include

using namespace std;

int main()
{
string str="数学。数学。数学。";

//Split
vector vs;
//regexU3 stores expression.
boost::u32regex regexU32= boost::make_u32regex("。");
boost::split_regex(vs, str,regexU32);
cout<

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.