EmEditor (text editor) Forum Index
   Regular Expressions
     help with macros
Register To Post

Threaded | Oldest First Previous Topic | Next Topic | Bottom
Poster Thread
Stefan
Posted on: 3/25/2013 12:14 pm
Home away from home
Joined: 7/14/2008
From: Germany, EU
Posts: 259
Re: help with macros to search and remove parts
.

Please try to find better subject lines for your threads
and use different threads for different kind of topics.

.

To do most of this, best learn Regular Expressions.

For example on:
- delete everything included in brackets (xxx) including the (brackets) themselves

Find: \(.+?\)
Replace:
[X] Use Regular Expressions

will match first
(xxx)
and then
(brackets)

due to the '?' regex parameter.

---

Whereas

Find: \(.+\)
Replace:
[X] Use Regular Expressions

will match whole
(xxx) including the (brackets)


- - -

For [ and ]
use

Find: \[.+\]
Replace:
[X] Use Regular Expressions

- - -

- delete everything after the first ( in everyline, including the bracket itself

Try
Find: \(.+$
Replace:
[X] Use Regular Expressions

- - -

- delete double or more spaces (not tabs) and replace them with one space

Try
Find: ~~+
Replace: ~
[X] Use Regular Expressions

(instead of '~' enter an blank each)

- - -


To create a macro try to utilize
- "Macro > Start"
- do the work, here the find and replace job
- "Macro > Stop"
- "Macro > Edit" --> you will see the macro code to reuse
(you may want to read the help about e.g. "eeFindSaveHistory" and remove this from the macro)

- - -

For the other questions *I* suggest you to open different threads
for each topic to not mix up all the answers and queries and for an back.

_
user
Posted on: 3/25/2013 3:30 am
Home away from home
Joined: 9/29/2006
From:
Posts: 212
help with macros
hello!

can you help me please to make these macros:

- delete everything included in brackets () including the brackets themselves


- delete everything included in brackets [] including the brackets themselves

- delete everything after the first ( in everyline, including the bracket itself

- delete double or more spaces (not tabs) and replace them with one space

- replace the text of each line with the url of the first google result of the search of that text

- replace the text of each line with the http://www.domain.com/ of the first google result of the search of that text (not the first url, which can be http://something.domain.com/something/more, but the http://www.domain.com/ only)

thanks!
Threaded | Oldest First Previous Topic | Next Topic | Top


Register To Post
 
English čeština Deutsch español français italiano 日本語 한국어 Русский 简体中文 繁體中文