R
R
rain1392020-05-19 10:57:49
PHP
rain139, 2020-05-19 10:57:49

How to get a substring up to a comma?

There is a line "egor krush, egoro, egorino, egran". It must be returned

when requested . Now I use:"ego"["egoro krush","egoro","egorino"]

preg_match_all('~ego[\w]*~i',"egor krush, egoro, egorino, egran", $match)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Timur Pokrovsky, 2020-05-19
@rain139

ego[^,]*
https://regex101.com/r/vtpUbU/1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question