On Nov 19, 2009, at 5:55 AM, Birger Borgwardt wrote:

> Hello. I want to copy a text from a file name to the alt="" text field
> F. example
> picture.jpg to alt="picture"
>
>  src="/images/thumbs/pic1.jpg" alt=""
>  src="/images/thumbs/pic1.jpg" alt="pic1"
>
> Is it possible in BBE?


This is just an early-morning, pre-coffee stab at a grep search- 
replace pattern. It works for your specific example, but also assumes  
that your file name is two levels down from root, and that it contains  
only letters and numbers (and that the file name suffix contains three  
letters). If any of these varies, the search pattern will have to be  
made more flexible. In any case, I'd expect that the more expert  
greppers on this list will come up with something better.

search pattern:

^(src=\"/[\w\d]+/[\w\d]+/)([\w\d]+)\.[\w]{3}(\"\salt=\")(\")

replace pattern:

\1\2\3\2\4


I hope this helps,

Peter


--
Peter Weil, Web Developer
University Communications
University of Wisconsin-Madison
Phone: 608-262-6538
Email: [email protected]





-- 
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 [email protected]
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 feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.

Reply via email to