Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. Текст
- 2. Текст
- 3.1 Текст
- 4. Текст
- 5 Текст
- /(.*)[.|] (.*)/s
- /(.*).? (.*)/
- /(.*)(.|) (.*)/s
- /(.*?).? (.*)/
- $string = "4.1 sdkjfglhgbkjlfgdf sfghjkghd";
- list($number, $text)= explode(' ', $string, 2);
- $number = strstr($string, ' ', true);
- $text = strstr($string, ' ');
- (^|n)(([0-9][.]?)+)+[s]+(.+)
- //$str = 'Текст3';
- //$str = 'Текст 3';
- //$str = '3Текст';
- //$str = '3/5 Текст';
- $str = 'Текст 3.7';
- preg_match_all('~(d+)?(?(1)(?:.d+)?|[^sd]+)~', $str, $arr);
- echo '<pre>', print_r($arr[0], 1), '</pre>';
- /*
- Array
- (
- [0] => Текст
- [1] => 3.7
- )
- */
Add Comment
Please, Sign In to add comment