search for:
src="../formulaPNG/(.*)" title=
replace with:
src="../formulaPNG/\1\.png" title=
chazl
Chaz Larson - ch...@jeck.com
> --
> You received this message because you are subscribed to the
> "BBEdit Talk" discussion group on Google Groups.
> To post to this group, send email to bbe...@googlegroups.com
> To unsubscribe from this group, send email to
> bbedit+un...@googlegroups.com
> For more options, visit this group at
> <http://groups.google.com/group/bbedit?hl=en>
> If you have a feature request or would like to report a problem,
> please email "sup...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
>
Here's another way to do it.
I'm assuming that you want to add .png to any filename that doesn't already
have a suffix.
I'm also assuming that all the img tags use double-quotes around the value
for the src attribute, because it makes the regex simpler...
Find:
(<img\s[^>]*src="(?:[^"]+/)?[^"/.]+)"
Replace:
\1.png"
HTH,
Ronald
> I'm also assuming that all the img tags use double-quotes around the value
> for the src attribute, because it makes the regex simpler…
> (<img\s[^>]*src="(?:[^"]+/)?[^"/.]+)"
Because regexes are being mentioned, I am compelled to remind people about the excellent publication "Mastering Regular Expressions" - an O'Reilly book (so you *know* it's good): http://oreilly.com/catalog/9780596528126/
There is also the website http://www.regular-expressions.info/ - which is basically a big advertisement for "RegexBuddy" (but it's a Windows application, so of little use to BBEdit users)
Apologies for the diversion
Alex
I have the second edition (about ten-twelve years old now, I guess). I don't think regex has changed that much in ten years though. Should I get the new edition?
--
National Socialism is not Socialism, any more than the Black Panthers
were actually cats. @jearl
Though largely tutorial in nature, the Forta book also serves as a reference book. It's the first book I reach for if I need to noodle out a regular expression problem. The $15 book (well, $15 when I bought it in 2008) also has some "canned" regular expressions that can be used to work with such things as ZIP codes (US, UK, Canada), US Social Security numbers, credit card numbers, IP addresses, URLs, email addresses, and HTML- and Java-style comments. It even has a web link to a regular expression tester. All in all, it's a very useful addition to my collection of regex books.