Posted 20 years ago by Cooldaddy - Novi, MI
Avatar
If I set the search type to be 'RegularExpression' and call the 'RepaceAll' method, it doesn't take into consider the 'ReplaceText' value to be regular expression as well.

Example:
FindText={}
ReplaceText={\n}\n => \n adds a new line return

It would be nice if the FindReplace throws a event which users can change the replace value.

Other editor tools allows users to use regular expression for replacing text (i.e Textpad).

[ 09-20-2004: Message edited by: Cooldaddy ]

Comments (6)

Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Correct.. I'll add that to the TODO list.


Actipro Software Support

Posted 19 years ago by tobias weltner
Avatar
Does anyone know whether regex is allowed in replace by now?

Also, how would I limit a find/replace to a specific line? I could create a selection, but the selection seems to be always visible to the user. Is there another concept? Thanx!
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yes, version 3.0 supports regex replaces.

Also many of the methods in the Document version of the find/replace object model allow custom ranged searches via overloads. Use Document.FindReplace to get to that object model.


Actipro Software Support

Posted 19 years ago by tobias weltner
Avatar
I am looking for text that needs to be replaced *only* if it is a specific token (not inside of strings).
Currently, I use Find to find the text, then evaluate the token, then do a replace if appropriate.
That seems quite expensive.
Is it possible to search for expressions that belong to a specific tokenset?
If not, is it possible to find an expression using "find" and if it matches the desired tokenset, call a method to do a replacement operation instead of having to call "Replace" again to start a new search?

I also experimented with tokenstream. However, when I replace documentline.text with the replacement text, I sometimes get strange results.

Any suggestions? Thanks!!
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
There currently isn't any searching facility to limiting to certain token types but I'll add that to the TODO list.

What problem are you seeing with replacing DocumentLine.Text?


Actipro Software Support

Posted 19 years ago by Boyd - Sr. Software Developer, Patterson Consulting, LLC
Avatar
Just a note... I've used all the new features available in SE 3.0 to implement my own advanced find/replace techniques that allow me to limit selections and expand my searches over multiple documents. Some things were easier than others, but all the capabilities are there. With a little work, you should be able to accomplish anything you want.
The latest build of this product (v24.1.0) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.