Question

I want to use Find and Replace in dream weaver to find and replace only the words which their lines contain a specific string.

Was it helpful?

Solution

user3503851, Dreamweaver has a notoriously shoddy regex flavor. Nevertheless, here is a working example, tested in CS6.

Our test text:

My Untitled Document Is Here
My Beautiful Document Is Here
My Document, the Beautiful

The goal: replace "Document" with "Blog", but only in a line that contains the word "Beautiful"

Search: ((?=.*?Beautiful)[^\r\n]*)(Document)

Replace: $1Blog

Result:

My Untitled Document Is Here
My Beautiful Blog Is Here
My Blog, the Beautiful
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top