| 246 | |
| 247 | template <bool isSpark34Plus = false> |
| 248 | static std::vector<std::string_view> javaStyleSplit( |
| 249 | std::string_view input, |
| 250 | std::string_view pattern, |
| 251 | int32_t limit) { |
| 252 | if (pattern.size() == 0) { |
| 253 | return javaStyleSplitFastEmptyPattern<isSpark34Plus>(input, pattern, limit); |
| 254 | } else { |
| 255 | std::string new_pattern = std::string(pattern); |
| 256 | auto isRegex = stringCore::checkRegexPattern(new_pattern); |
| 257 | if (!isRegex) { |
| 258 | return javaStyleSplitFast(input, new_pattern, limit); |
| 259 | } else { |
| 260 | return javaStyleSplitRegex(input, pattern, limit); |
| 261 | } |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | } // namespace javaStyle |
| 266 | } // namespace bytedance::bolt::functions |