There is a list of name, example:

Иванов Иван Иванович Петров Петр Петрович Сидоров Сидор Сидорович 

Task:
after the name (in the position of every second space) put the character ;

Result:

 Иванов Иван;Иванович Петров Петр;Петрович Сидоров Сидор;Сидорович 

Implement using regular expressions, without reference to any programming language (replacement in NOTEPAD ++).

The task is much more difficult, but I already figured out the answer below.

  • @out, According to the rules of the forum, questions should not be limited to solving or completing student assignments. Please clarify what you have done yourself and what did not work out. - angry
  • one
    It seems correct and good question. - ivkremer

2 answers 2

Found the right solution, thanks @ToolTip .
In NP ++
Find ^(\S+)\ (\S+)\ (\S+)$
Replace with \1 \2;\3

     var str = 'Иванов Иван Иванович'; var regex = /^([^\ ]+)\ ([^\ ]+)\ ([^\ ]+)$/; str = str.replace(regex, "$1 $2;$3"); document.write(str)​; 

    An example .

    • No, not quite that (I can programmatically without a regular expression at all). Implementation is necessary ONLY with the help of a regular expression (search for the second space in the string). Ctrl + H in Notepad ++. - out