T
T
Talent Artelov2015-06-17 11:11:38
Regular Expressions
Talent Artelov, 2015-06-17 11:11:38

How to remove part of text using regular expressions?

There are lists, in one list there are more than 2000 lines. Lists are presented in the following form:

- /(///(111(222)333)\\\?) @ /(///(111(222)333)\\\?) @ /(///(111(222)333)\\\?)
 - /(///(111(22)333)\\\?) @ /(///(111(22)333)\\\?) @ /(///(111(22)333)\\\?)

Now we have to remake them in such a form, which is presented below:
- 111(222)333 @ /(///(111(222)333)\\\?) @ /(///(111(222)333)\\\?)
 - 111(22)333 @ /(///(111(22)333)\\\?) @ /(///(111(22)333)\\\?)

I would appreciate any advice and assistance in resolving this issue.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
ShamblerR, 2015-06-17
@ShamblerR

sed
but in general, for clarity, the files would be given, it’s hard to watch without a real example.

D
Dvvarreyn, 2015-06-17
@Dvvarreyn

You can use sed as ShamblerR pointed out .
But you can do it right in Sublime via replace
To delete, you need to mark those honors that need to be saved using brackets r'(save) delete (save)'.
And already in the replacement field, write something like
\1 New text \2
(or $1 $2)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question