questions about search/replace

Oxygen general issues.
LBarth
Posts: 26
Joined: Mon Mar 04, 2013 1:42 pm

questions about search/replace

Post by LBarth »

Hi,

Is there a way to search text and replace it surrounded by tags in author mode ? (I would prefer my users not to use text mode)
For instance to replace 'blabla' by 'blabla' in italic using html tag <i/>.

When in search/replace 'case sensitive' is uncheched, replace does not keep initial capital letters on words as Word does, for instance if I search 'tps' and want to replace by 'tapas', all 'Tps' are replaced by 'tapas' and not 'Tapas'. In fact the case in insensitive on search but sensitive on replace. Is there a way to mimic Word behaviour ?

Best regards,
Lionel
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: questions about search/replace

Post by adrian »

Hi,
LBarth wrote:Is there a way to search text and replace it surrounded by tags in author mode ? (I would prefer my users not to use text mode)
For instance to replace 'blabla' by 'blabla' in italic using html tag <i/>.
You could use the 'Find/Replace in Files' to replace 'blabla' with '<i>blabla</i>', but note that it actually processes the content of the files from the file system, not the content of the editors, so the edited files must be saved first if there are pending changes. You will be prompted to save the modified files when you use the 'Find/Replace in Files' dialog.
LBarth wrote:When in search/replace 'case sensitive' is uncheched, replace does not keep initial capital letters on words as Word does, for instance if I search 'tps' and want to replace by 'tapas', all 'Tps' are replaced by 'tapas' and not 'Tapas'. In fact the case in insensitive on search but sensitive on replace. Is there a way to mimic Word behaviour ?
The 'Case sensitive' option from the Find/Replace dialog refers to the searched text. If 'Case sensitive' is enabled the searched text must be an exact match.

The only way of mimicking the Word behavior in Find/Replace is to use a regular expression, but this only works if you keep the same first letter. This lets you keep it as it is, capitalized or not.
e.g. tps -> tapas (keep t/T capitalization)
Text to find: (t)ps
Replace with: $1apas

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply