emeditor not responsive when replace with nexline regex \n - emeditor

I met such a problem, when i want to replace millions or more matching words with new line regex \n ( to split the content into millions lines)
.
The replacing tasks looks took a very long time. and looks no responding.
I'm Using the lastest version.in window 10.
Can you check if this can be solved ?

\n is an escape sequence as well as a regular expression. Select Escape Sequence instead of Regular Expressions in the Replace dialog box to increase the replacement speed.

Related

Trimming chr(49824) in the middle of a field in oracle

Unable to trim the non breakable space in the middle of a filed in oracle
'766195491 572'
Tried the below method it works only when non breakable space is present on the sides.
select length(trim(replace('766195491 572',chr(49824),''))) from dual;
it works only when non breakable space is present on the sides
That’s what the trim() function is supposed to do:
TRIM enables you to trim leading or trailing characters (or both) from a character string
“leading or trailing” means “at the sides”. It is not supposed to have any effect on appearances of the characters anywhere else in the source string.
You need to use the replace() or translate() functions instead; or for more complicated scenarios, regular expression functions.
If the input value is in a column named input_str, then:
translate(input_str, chr(49824), chr(32))
will replace every non-breakable space in the input string with a regular (breakable) space.
If you simply want to remove all non-breakable spaces and don't want to replace them with anything, then
replace(input_str, chr(49824))
(if you omit the third argument, the result is simply removing all occurrences of the second argument).
Perhaps the requirement is more complicated though; find all occurrences of one or more consecutive non-breaking spaces and replace each such occurrence with exactly one standard space. That is more easily achieved with a regular expression function:
regexp_replace(input_str, chr(49824) || '+', chr(32))
Try CHR(32) instead of CHR(49824)
select length(replace('766195491 572',chr(32),'')) from dual;
If it does not work, use something like this.
select length(regexp_replace('766195491 572','[^-a-zA-Z0-9]','') ) from dual;
DEMO

Select multiple words and characters using GREP

I need some GREP help. I'm trying to search for text in an InDesign file that has lesser-than "<" and greater-than ">" characters on either end. The text could be one word or more and could include spaces and even numbers. But, here's here's the catch, there may be multiple words on a line, such as , , <12 peaches> and <3 plums>.
I tried using <(.+)> but this picks up the whole paragraph and removes the beginning and ending brackets < > but leaves the ones in the middle.
Anyone know the proper wildcard structure that would find any text or number between these brackets and even if more than one set of "<>" appear in a single paragraph?
FYI, GREP in InDesign is not exactly the same as it's used on the web.
The + metacharacter is greedy meaning it tends to catch more than needed. You can restrain it with a question mark like this :
<.+?>
or change your pattern with
<[^>]+>

How to delete several lines containing only whitespaces in nano?

I have been using nano to write a bash script and I am at several times indenting various lines at once with Alt + }. The problem is that the following occurs:
Several lines without text in them get white-spaces by the amount that I indent the text and they are coloured green. They don't affect the program but they make it look bad. I have been deleting them one by one but it gets frustrating over time. Is there a way to get rid of all the white-spaces at once? maybe some way to select the text (short cut for selecting text in nano is Alt + a) and have a short cut do it?
Use global search and replace with the expression ^\s+$.
Switch to search and replace mode with C-\.
Switch to regex mode with Alt-R.
Type the expression ^\s+$.
Hit Enter to replace with an empty string.
On the match, hit A for All.

Block Indent Regex

I'm having problems about a regexp.
I'm trying to implement a regex to select just the tab indent blocks, but i cant find a way of make it work:
Example:
INDENT(1)
INDENT(2)
CONTENT(a)
CONTENT(b)
INDENT(3)
CONTENT(c)
So I need blocks like:
INDENT(2)
CONTENT(a)
CONTENT(b)
AND
INDENT(3)
CONTENT(c)
How I can do this?
really tks, its almost that, here is my original need:
table
tr
td
"joao"
"joao"
td
"marcos"
I need separated "td" blocks, could i adapt your example to that?
It depends on exactly what you are trying to do, but maybe something like this:
^(\t+)(\S.*)\n(?:\1\t.*\n)*
Working example: http://www.rubular.com/r/qj3WSWK9JR
The pattern searches for:
^(\t+)(\S.*)\n - a line that begins with a tab (I've also captured the first line in a group, just to see the effect), followed by
(?:\1\t.*\n)* - lines with more tabs.
Similarly, you can use ^( +)(\S.*)\n(?:\1 .*\n)* for spaces (example). Mixing spaces and tabs may be a little problematic though.
For the updated question, consider using ^(\t{2,})(\S.*)\n(?:\1\t.*\n)*, for at least 2 tabs at the beginning of the line.
You could use the following regex to get the groups...
[^\s]*.*\r\n(?:\s+.*\r*\n*)*
this requires that your lines not begin with white space for the beginning of the blocks.

How to replace multiple lines in Visual Studio 2008

I need to do a find and replace, where I need to replace 2 lines at time. Does anyone know how to do this in the VS2008 IDE?
To clarify, i want to replace 2 lines with 1 line.
Many thanks
Thanks to František Žiačik for the answer to this one.
To perform a find/replace, replacing multiple lines, you need to switch on regular expressions and use a line break (\n) between your lines, also using (:b*) at the start of each line to handle any tabs or spaces tabs.
So to find:
line one
line two
you would search for ":bline one\n:bline two" (without the quotes)
Try Multiline Search and Replace macro for Visual Studio.
You can activate the 'Use regular expressions' in the find dialog, and use \n to match a newline.
In your case, type FirstLine\n:Zs*SecondLine.
:Zs* skips leading blanks on line 2.
For example ,\n:Zs*c matches a comma, newline, any number of blanks, a 'c'.

Resources