<DESCRIPTION_LONG>PVC-Steuerleitungen 2YSL(St)CYv-J Norm: - Nennspannung: 0,6/1 kV Isolier-/Mantelwerkstoff: PVC, verstärkt Farbe: schwarz Flammwidrigkeit: nach VDE 0472 Teil 804 Prüfart B (=IEC 332-1) ; Verwendung: Die Leitung ist speziell für das EMV-gerechte Anschließen von Frequenzumrichtern entwickelt. Für feste Verlegung und gelegentliche Bewegung in Innenräumen und im Freien. auf Trommel. Basis 150<p>Kupfer (kg pro 100m): 23,5<p>Außen-& # 2 4 9; (mm): 14,5</DESCRIPTION_LONG>
You misunderstand the character class notation [...]. A character class expression matches exactly one character. For example, your expression [^&#...;] matches any one character that is not &, #, . or ;, since it begins with a ^.
In TextPad you cannot find text that does not match an arbirary regular expression. Can you rephrase your requirement to indicate what you are looking for? - for example, semicolons preceded by a single character that isn't a letter or digt? This regular expression will match those: [^a-z0-9];
ben_josephs wrote:You misunderstand the character class notation [...]. A character class expression matches exactly one character. For example, your expression [^&#...;] matches any one character that is not &, #, . or ;, since it begins with a ^.
In TextPad you cannot find text that does not match an arbirary regular expression. Can you rephrase your requirement to indicate what you are looking for? - for example, semicolons preceded by a single character that isn't a letter or digt? This regular expression will match those: [^a-z0-9];
Thanks for your answer, I search the semilcolons ";" which are not in & or > and other html or ascii code. That means a ";" which stands alone and not in relationship with html code.
In Line 2 the semicolon here "Norm: ;" is wrong and have to delete.
I don't understand. My suggested regular expression does find the semicolon in Norm: ;
because it's preceded by a space, which isn't a letter or a digit.
My main problem is, that semicolons behind as < or > are correct, because the are part of a html code. But semicolons, which stands anywehre in this row are not correct and interrupt my import.
As I understand it, you want to find those semicolons that are not preceded by text that matches either &[a-z]+ or &#[0-9]+. There's no easy way that I am aware of to do that in TextPad.
What you need is a means to specify, positively or negatively, the context around the semicolons. Look-ahead and look-behind constructs provide these means, but they are not available with TextPad's aged regular expression recogniser. Look-ahead, which looks at the context following the text you want to match, is available in WildEdit; but what you need is look-behind, which looks at the context preceding the text you want to match, and that is not available in WildEdit. With positive look-behind you can specify what the text you are interested in must be preceded by. With negative look-behind you can specify what it must not be preceded by. So it is negative look-behind you need.
However, most languages that provide look-behind impose the restriction that all matches of the look-behind expression must be of the same length. So you have to specify separately look-behind expressions of different lengths, say: &[a-z]{2} &[a-z]{3} &[a-z]{4} &#[0-9] &#[0-9]{2} &#[0-9]{3}
For example, in Perl, this or a similar regular expression matches just the semicolons you want to remove: (?<!&[a-z]{2})(?<!&[a-z]{3})(?<!&[a-z]{4})(?<!&#[0-9])(?<!&#[0-9]{2})(?<!&#[0-9]{3});
Can we be reasonably certain that all ILLEGITIMATE semicolons in your code ARE preceded by spaces? In other words, could there be any that are NOT preceded by spaces?
If some of the illegitimate semicolons are preceded by characters other than spaces, then can we be reasonably certain as to what those non-space characters are? In other words, is there a definite regularity to the characters that precede the illegitimate semi-colons?
(Can we be reasonably certain that all LEGITIMATE semicolons in your code are NOT preceded by spaces? In other words, could there be any that ARE preceded by spaces?)
These are important questions, because coming up with accurate regular expressions depends ENTIRELY upon what the implementer of those expressions is ABLE TO KNOW about the code that is to be searched.
If the situation is such that there is no way to know EXACTLY what lurks in the code that is to be searched, then we are all . . . "up the creek without a paddle."
If we are to do this accurately (why would we want to do it any other way?), we need to identify the presence of some kind of regularity--about the illegitimate semicolons--upon which we can depend 100%.
Is there any other character or pattern of characters (such as parentheses or an acronym) that ALWAYS precedes (or succeeds), in some nearby and consistent way, an illegitimate semi-colon? If this is not able to be known, by the code, . . . my heart goes out to you. 25 billion lines makes me shudder.
The final thing to mention is that breaking up a search into a number of simpler searches can often increase the power of regular expressions.
So, try to analyze the situation with as much detail as you can.
Sorry if some of this sounds obvious, especially to those who are very experienced with REs; however, different perspectives are often useful and FOCUSING on what is of the utmost importance can often be beneficial.
I came in on 4.5 in 2001, moved to 4.7.2 in 2004, moved to 4.7.3 in 2007, moved to 5.4 in 2010, and am excited about 2013. I've said it many times before, and I'll say it many times again: "I love this program."