At 4:39 pm -0700 13/9/06, Michael Heth wrote:
>Well that worked but I didn't notice that the space was not always changed to
>an underscore and now with all the links in a page I need to go back and do
>this
>
><table cellspacing="3" cellpadding="3" align="left">
><TR><TD><A HREF="novato bluecross_insurance.html">novato bluecross
>insurance</A></TD></TR>
></table>
>
>to this,
>
><table cellspacing="3" cellpadding="3" align="left">
><TR><TD><A HREF="novato_bluecross_insurance.html">novato bluecross
>insurance</A></TD></TR>
></table>
Find:
(<A HREF="[^"\s]*)\s+
Replace:
\1_
Repeat until it no longer finds any matches.
Just in case, here's a regex to find any links that aren't to html files named
with only the lowercase letters a-z, digits, underscores or hyphens. Slashes
are allowed too, though you might not want that. The (?-i: ) bit makes the
matching inside it case-sensitive.
Find:
<A HREF=(?-i:"(?![a-z][a-z0-9_/-]+\.html")[^"]*")[^>]*>
Finally, I hope you don't mind me asking whether you really need to wrap every
link in a table? If you are create just a list of links then the appropriate
HTML structure would be an unordered list.
<ul>
<li><a href="/foo">Foo</a></li>
<li><a href="/bar">Bar</a></li>
</ul>
James Harvard
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <[EMAIL PROTECTED]>