#1
|
|||
|
|||
Finding characters "="
1. I want to find only 3 characters ===
2. I want to ignore find every other number of characters = 3. I want to find all characters = containing a different number than 3 characters = All regex not work: [^ ===] ^ [^ ===] ! "===" = |
#2
|
||||
|
||||
How about learning regex and not guessing?
It seems you doesn't even know what [] is ? This is the pattern for your first question Code:
([^=]|^)(===)([^=]|$)
__________________
JD-Dev & Server-Admin |
#3
|
|||
|
|||
^={3}$
OR ^[^=]*===[^=]*$ OR ([^=]|^)(===)([^=]|$) searches for 3 characters but that's not what I mean I want: Each character = (except for 3 characters === and one character in http) should be replaced with 3 characters === |
#4
|
||||
|
||||
that is what the pattern does, find the ===
__________________
JD-Dev & Server-Admin |
#5
|
||||
|
||||
How about an example that everyone understands?
__________________
JD-Dev & Server-Admin |
#6
|
|||
|
|||
I have links in the text file that do not contain or contain at least one character or more in the address "="
Here he does not want to change anything. But in the text file the links are separated in a line with a different combination of = chars, and I want to replace all of them with 3 characters = = OR == OR ==== OR more character "=" always replace with === Line: 1.= replace with === 2.== replace with === 3.=== NOT REPLACE 4.==== replace with === 5.===== or more = replace with === 6.**External links are only visible to Support Staff****External links are only visible to Support Staff** name= NOT REPLACE |
#7
|
||||
|
||||
Why not simply replace all =+ with === !?
__________________
JD-Dev & Server-Admin |
#8
|
|||
|
|||
Because in the text file, there are http links with one or more characters =, and how they will replace the link will not work.
|
#9
|
||||
|
||||
So you're only interested in =... at the beginning of the line?
Maybe you should provide real example
__________________
JD-Dev & Server-Admin |
#10
|
|||
|
|||
So you're only interested in =... at the beginning of the line?
YES. Example not needed because from the beginning there are only character = of course in different quantities! Line1:=============== Line2:==== Line3.====== etc. |
#11
|
|||
|
|||
It works, but the regular expression must be changed because every character starts from the beginning of the line. There must be an exception for HTTP links in which the = CHARACTER also appears
Ignore replacing characters in any url link in which the character is = Find:=* Replace with:=== Line1:**External links are only visible to Support Staff****External links are only visible to Support Staff** (VARIOUS TYPE URL) Line2:==== |
#12
|
|||
|
|||
Maybe:
Find:^=*$ Replace with:=== |
#13
|
||||
|
||||
That won't work because this pattern does only match empty lines or just with =
__________________
JD-Dev & Server-Admin |
#14
|
||||
|
||||
How about
Code:
^=+
__________________
JD-Dev & Server-Admin |
#15
|
|||
|
|||
Works in both cases for me, I checked it on a text file.
Only in the first case is the $ character (End of line) required because the editor will show(when replace) for URL: Code:
===http |
Thread Tools | |
Display Modes | |
|
|