Thanks for your help Patrick, Kerri, Lewis. Patrick thanks for the
detailed explanations of the process much appreciated.

Regards

> == 2 of 6 ==
> Date: Mon, Nov 24 2008 6:51 am 
> From: Patrick James  
> 
> 
> Hi
> 
> I think BBEdit is ideal for this task.
> 
> It is a matter for Find/Replace.
> 
> If we think about this example:
> 
> <img src="example.jpg" alt="Example" >
> 
> <img src="example.jpg" alt="Example" >
> 
> Then what we do is put this in the Find with Grep box checked:
> 
> Find: alt=(".+?")
> 
> Then put this in the replace: & title=\01
> 
> And it will change the example to:
> 
> <img src="example.jpg" alt="Example" title="Example" >
> 
> A very brief explanation in Find:
> 
> alt= is literal and so are the " and " (".+?")
> 
> however . means anything except a return character
> 
> and +? is quantifier for . meaning roughly, keep matching anything up  
> until the following literal character which is ".
> 
> The parentheses will capture that part of the expression and keep them  
> ready to be put into the replace expression.
> 
> In the replace we have:
> 
> & which means replicate the whole of the found string.
> 
> title= is literal as is the space preceding it.
> 
> \01 will put in the bit of the find expression we captured with the  
> parentheses.
> 
> There is one important caveat which is that run over a file or files  
> this expression will change all instances of alt="Example" it is not  
> applied only to that string within the img tags. I can't at the moment  
> think where a string like that might be in HTML other than in img tags  
> but we could make sure that it only happens to the string in the img  
> tag if we wished. For that I would use a loop in an AppleScript  
> finding first: <img.+?> then in that selection perform the Find/ 
> Replace described above, then AppleScript loop would move us to the  
> next instance of <img.+?> continuing until all is done.
> 
> You will be able to open all the files on the server with BBEdit and  
> then save them straight back to the server.
> 
> For more info about Grep find/replace there is an excellent guide in  
> the BBEdit Help.
> 
> Best of luck :)
> 
> 
> Patrick
> 
> http://www.patrickjames.co.uk
> 

> > >
> 
> 
> 
> 
> 
> == 3 of 6 ==
> Date: Mon, Nov 24 2008 7:18 am 
> From: "[EMAIL PROTECTED]"  
> 
> 
> Find:
> alt="([^"]+)"
> 
> Replace:
> title="\1"
> 
> Or
> 
> Alt="\1" title="\1"
> 

> 
> 
Cahit Okten photographer
"Quality isn't expensive... It's priceless"

Contemporary fine art portrait and wedding photography
Tel :+44 (0)1353667822
Email: [EMAIL PROTECTED]
Mobile:07950773981
skype:garibaldistudios


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "[EMAIL PROTECTED]" 
rather than posting to the group.
-~----------~----~----~----~------~----~------~--~---

Reply via email to