I want to replace only first occurrence of word(default) in each line with another word(rwd).
As below I want this:
../app/design/adminhtml/default/default/layout/pmodule.xml
../app/design/frontend/default/default/layout/pmodule.xml
../app/design/frontend/default/default/template/company/module/gmap.phtml
To be replaced to this:
../app/design/adminhtml/rwd/default/layout/pmodule.xml
../app/design/frontend/rwd/default/layout/pmodule.xml
../app/design/frontend/rwd/default/template/company/module/gmap.phtml
I have tried \bdefault\b
but in vain.
^(.*?)\bdefault\b
-->\1rwd
work? I think lazy matching here is a much better solution than a tempered greedy token suggested in the answer below. – Rego\bdefault\b(.*)
and replace withrwd\1
(similar wiktors answer) – Annates