L
L
lolpw2015-10-13 13:34:04
Regular Expressions
lolpw, 2015-10-13 13:34:04

What's the regular expression for splitting text between small and capital letter?

Good afternoon.
There is a text in which the names of the streets are "glued together", for example: Velyka Zhytomyrska
Please tell me the regular expression to separate "аЖ" with a space, i.е. find two characters (small letter and capital letter) and put "space" between them

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Optimus, 2015-10-13
@lolpw

preg_replace regular expression regexr.com/3bvkr and replace with
"$1 $2"

E
enibeniraba, 2015-10-13
@enibeniraba

A special case of the previous answer for php and unicode + the letter Y:

preg_replace('/([а-яё])([А-ЯЁ])/u', '$1 $2', 'ВеликаЖитомерська')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question