How do I replace only the first <br> tag across multiple files?
-
@guy038 Terrific! You are great! I was sensible enough to figure out that by, “
sensible to case
” you mean, “case sensitive
” and by, “The $0 syntax represents the overall match, so the string <br>, with this exact case
” you mean, “The $0 syntax represents the overall match, which is the string <br>, with this exact case
”. You must be French.Merci beaucoup
for your help! I learnt French some 30 years ago butje ne peux pas parler beaucoup de français
simply because I seldom bumped into French speaking people later. -
@Terry-R No problem!
-
@PeterJones
@Scott-Nielson said in How do I replace only the first <br> tag across multiple files?:@Alan-Kilborn or anyone else. I am doing Edit->Line Operations->Reverse line order, then in the RegEx mode,
Find:^[^/]+\K<br>
to find the last (which is actually the first since the lines are reversed)<br>
tag in each section and Replace:<br>zxcvb
,
Then Find:(?s)(?<=color:black'>)-(.*?) *(?=zxcvb)
and Replace:qwerty$1xxx
where qwerty and xxx are some HTML codes I wanna add but is there a RegEx that can help me do the needful without the Edit->Line Operations->Reverse line order (to find the first<br>
tag in each section)?By the above, you should have figured out that I do try to figure out how to do these things.
I seek a solution here only if I am unable to figure out what to do and will continue to do so - I ain't too proud to beg.
I thank you for the RegEx that helped me find the very first<br>
tag -(?s)\A.*?\K<br>
Thanks again! -
@PeterJones If you give me a link to check out something or give me a hint, I do check it out but luckily, @guy038 gave me the right solution (spoon feeding as you call it)!
-
Hi, @scott-nielson and All,
A bit off-topic : Yeah, it’s a common mistake when doing translations ! In French, this kind of words are known as “faux amis” words ! Just because :
-
In English, the adjective
sensible
have the French sense ofraisonnable
/sensé
orpratique
-
In French the adjective
sensible
have the English sense ofsensitive
ornoticable
So, I should have used the expression
sensitive to case
!Cheers,
guy038
-