A few questions about regular expressions

Good day everyone!
I never cease to enjoy working with EDT, and I study the possibilities of regular expressions. Much is clear, but there are questions on which I want to ask for help.
Javascript has not been dealt with yet, so now I’m interested in a possible solution with the help of regular expressions.
Here are some questions that I don’t understand.
The full text is as follows.

“The boat with the tail number AK: 345678 overtook the boat S/N 45444 (date of launching 25-07-1930), which returned from repairs”

Is it possible to extract the following parts of the text from each line with my example?

  1. “The boat with the tail number AK: 345678” (i.e. leave message text up to AK: 345678, plus boat number)

  2. “which returned from repairs” (leave all text after the date 25-07-1930, no date itself)

  3. AK: 345678 overtook the boat S/N 45444” (leave all text between AK: 345678 and S/N 45444, including their serial numbers)

The serial numbers, text and dates in the file are different, that is, they must be searched using regular expressions.
I learned how to find the values themselves using regular expressions, but I don’t understand how to make the selection of all text up to the desired value (such as date or serial number), or vice versa after what was found.
Please help if possible.

You can do it like this:

boats.transform (3.4 KB)

There might also be a more elegant way!

You can then combine the columns as required using Concat Cols.

You can use https://regex101.com/ to help construct the regex:

1 Like

Dear Admin, thank you very much! Now I understand everything. Special thanks for such a quick response. :handshake:

1 Like