對於某些數據處理,我需要將一個字符串拆分爲多個項目。 的輸入字符串的例子是: '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