Answer the question
In order to leave comments, you need to log in
How to find words without spaces between brackets?
You need to find all the words between the brackets, but only the words without spaces. I now find everything between the brackets:
$text = "Не следует, однако, забывать о том, что начало [повседневной] работы по [формированию позиции] влечет за собой [процесс внедрения и [модернизации] системы обучения кадров!";
preg_match_all("/\[([^\]]*)\]/", $text, $matches);
var_dump($matches[1]);
повседневной
модернизации
Answer the question
In order to leave comments, you need to log in
\S matches any character other than a space.
<?php
$text = "Не следует, однако, забывать о том, что начало [повседневной] работы по [формированию позиции] влечет за собой [процесс внедрения и [модернизации] системы обучения кадров!";
preg_match_all("/\[(\S+)\]/", $text, $matches);
var_dump($matches[1]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question