对于某些数据处理,我需要将一个字符串拆分为多个项目。 的输入字符串的例子是: 'one, two & three and four-five 123-456'
现在,我需要这个串分离成的物品,在可能情况下定界符是,,&,(空间),and,-。但是,这是我卡住的地方,它不应该分裂在-之间,当它在两个数字之间。 我使用PHP和preg_split做实际的分裂,但我需要一个正则表达式匹配的分隔符除所
我在PHP中使用preg_split函数将段落拆分为几个句子。 在我的情况: $str = 'Applicants can check the final result of Admissions through the online enquiry system. The online enquiry system will be available from 10:00 a.m. on Nov
我期待将一个段落分解成句子,然后转换为'分解'字符串,但需要将标点作为数组的元素。 示例文本: $meta = 'I am looking to break this paragraph into chunks.
I have researched, tried and tested various combinations; however, I cannot
seem
我正在使用preg_split将字符串拆分为单词。 但是,它不适用于从mysql文本列中提取的特定字符串。 如果我手动将字符串分配给一个变量,它将正常工作,但不是从数据库中提取字符串时。 下面是简单的代码我使用: //The failing string. When manually assigned like this it works correctly
$string = "<p><st