Hello, @Rana-jawad,
An equivalent regex to the Scott’s one would be :
SEARCH (?-s)(?<=\|).*
REPLACE Leave EMPTY !
Notes :
The first part (?-s) is a modifier, which forces the regex engine to interpret the dot regex character as standing for any single standard character ( not End of Line characters )
The last part .* tries to match any range, even empty, of standard characters
The middle part (?<=\|) is a positive look-behind, that is to say a condition which must be true for an overall match
This condition implies that the matched range of characters must be preceded by a literal vertical bar ( | ), which have to be escaped with an \, because the | character is the regex symbol for alternation
And, due to the empty replacement box, this range of characters, located after the | character, is simply deleted
However, just note that, with my regex or Scott regex, if some of your lines contains several | characters, any text after the first | character, will be deleted. For instance, the text, below :
string1 | string2 | string3
string4001 | string2668 | string1234
string201 | string202 | string203
would be changed into this one :
string1 |
string4001 |
string201 |
Best Regards,
guy038