S
S
SilverOK2011-09-13 11:20:32
PHP
SilverOK, 2011-09-13 11:20:32

Regular expressions: removing part of text?

Hello!
Need help removing unnecessary text in each of ≈3000 lines.
The task is this:
There is a file with ≈3000 lines, with content like: 12345 Sidorov V.B. vul.1 Travnya, 1
It is necessary to remove from all lines everything that starts with “vul.”, that is, remove addresses from the lists altogether.
It should be simple: 12345 Sidorov V.B.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
korvindest, 2011-09-13
@korvindest

The simplest option is this:
(^.*)(vul\..*)$ should be replaced by $1 (the first group)
and the flags (preferably) Case insensitive and multi line should be included
Checked here is a Java applet.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question