:%s/search/replace/flag
In latex, the author initials should not line break in the bibliography. Use ~ to prevent that.
To change "L. Deych" to "L.~Deych" in the author field,
author = \{([A-Za-z]). ([A-Za-z]+)\},
author = \{\1.~\2\},
Similarly, change "L. I. Deych" to "L.~I.~Deych"
author = \{([A-Za-z]). ([A-Za-z]). ([A-Za-z]+)\},
author = \{\1.~\2.~\3\},
author = \{([A-Za-z]). ([A-Za-z]+) and ([A-Za-z]). ([A-Za-z]+)\},
author = \{\1.~\2 and \3.~\4\},
author = \{([A-Za-z]). ([A-Za-z]). ([A-Za-z]+) and ([A-Za-z]). ([A-Za-z]). ([A-Za-z]+)\},
author = \{\1.~\2.~\3 and \4.~\5.~\6\},
([A-Za-z_.0-9-]+).flv
ffmpeg -i \1.flv -f mp3 -vn -acodec copy \1.mp3
Given the following HTML,
<a href="http://www.youtube.com/watch?v=WMPxoQqZ3KQ">Dilated Peoples -Back Again</a><BR>
<a href="http://www.youtube.com/watch?v=GCLl1ISqYwc">Dilated Peoples feat. Defari -Third Degree</a><BR>
<a href="http://www.youtube.com/watch?v=MrORIw-txM4">Big L - '98 Stretch & Bobbito Freestyle </a><BR>
The first thing to do is find and replace spaces, symbols.
<a href=" to ""
</a><BR> to ""
" " to _
' to ""
& to and
"> to " "
Now that the content is sanitized, replace
http([:A-Za-z./0-9-?_=]+) ([A-Za-z0-9_- ]+)
with
youtube-dl -b -o \2.mp4 http\1
Suppose I have a tex file with
\begin{equation}
\int_0^x f(y) dx
\label{eq:equation_name}
\end{equation}
\begin{equation}
x=2^{zy}
\end{equation}
\begin{equation}
\begin{gathered}
\vec{j}=5 \\
\vec{k}=2
\end{gathered}
\label{eq:another_equation}
\end{equation}
and I want to convert it to wiki format, which would be
<equation id="eq:equation_name">
<math>
\int_0^x f(y) dx
</math>
</equation>
<math>
x=2^{zy}
</math>
<equation id="eq:another_equation">
<math>
\vec{j}=5</math><BR><math>
\vec{k}=2
</math>
</equation>
How do make the conversion?
First, standard find and replace
\begin{equation} to <math>
\end{equation} to </math>
\label{eq: to <equation id="eq:
Note that I cannot replace
}\n\end{equation} with ">\n</math>
because the second equation does not have a label
With the above three find-replace, I have
<math>
\int_0^x f(y) dx
<equation id="eq:equation_name}
</math>
<math>
x=2^{zy}
</math>
<math>
\begin{gathered}
\vec{j}=5 \\
\vec{k}=2
\end{gathered}
<equation id="eq:another_equation}
</math>
Now we need regular expressions (regex) to finish the job.
Replace
<equation id="eq:([A-Za-z1-9_]+)\}\n</math>
with
<equation id="eq:\1">\n</math>
Then replace
<equation id="eq:([A-Za-z1-9_]+)">\n</math>\n([^<])
with
<equation id="eq:\1">\n</math></equation>\n\2
Thus we have
<math>
\int_0^x f(y) dx
<equation id="eq:equation_name">
</math>
</equation>
<math>
x=2^{zy}
</math>
<math>
\begin{gathered}
\vec{j}=5 \\
\vec{k}=2
\end{gathered}
<equation id="eq:another_equation">
</math>
</equation>
The next step is to move <equation id> to before the <math> tag. There is probably a better way to catch all the symbols in an equation, but I did not have luck using *
<math>\n([A-Za-z0-9_\{\}\\\ \=\(\)\-\+\^\|\'\!\,\/]+)\n<equation id="eq:([A-Za-z1-9_]+)">
with
<equation id="eq:\2">\n<math>\n\1
Note: this does not handle gathered equations,
Replace \\ with </math><BR><math> by changing
<math>\n\begin{gathered}\n([A-Za-z0-9_\{\}\ \=\(\)\-\+\^\|\'\!\,\/]+)\\
to
<math>\n\1</math><BR><math>
or $x$ (replace with <math>x<math> but skip \$100
http://www.funduc.com/regexp.htm#Regular%20Expression%20Replacements%20-%20Match%20Operators