I’m not as comfortable with RegEx as I’d like to be. What I’m trying to do is prepend every line (of a list of URL’s) with <a href=" and then end each line with "></a>
for the prepend, I’ve been using Replace with regular expressions: ^ with <a href="
this works alright, however, there are certain blank lines that get <a href=" added to them. Is it possible to replace the beginning of each line only if there’s more than 1 character in the line?
And as for doing the end of the line, I have no idea. Any help would be much appreciated–I have a very large amount of url’s in different text files to go through to edit.
Seach and replace by
^(?=.)and(?<=.)$instead. The period implies “any character, excluding a linebreak”. combined with^and$, it would be the start and end of a line that is followed by (or preceeded by in the case of$) a character. This example combines it with positive lookahead and lookbehind to ensure that you don’t replace any of the original line but append/prepend instead.