Announcement
Collapse
No announcement yet.
Regex Replacement + Replacement on selection
Collapse
X
-
Here's another try, for "Search > Replace":
1. Search > Replace doesn't have a "just selection" option, I'll add it to our wish list.
2. To insert a # in front of lines, check "Regular Expression", then use "(.*)" as the text to find. The ".*" matches on the whole line, the parenthesis save the matched text. The matched text is saved in the variable $1, so use the replacement text "#$1".Leave a comment:
-
1. Replacements affect the entire file. It isn't possible to set a replacement that is limited to a selection.
2. "^" is a special character in regular expressions that indicates the beginning of a line. Try escaping it and using "\^" to match on the caret character.
Edit:
Please ignore this, I thought you were referring to the "Replacements" tab in Session > Session Settings, not "Search > Replace".Last edited by Chris; 07-Jan-2009, 05:14 PM.Leave a comment:
-
Regex Replacement + Replacement on selection
Hi,
I'm using BC_3.0.13. I'm working on shell scripts & I had to comment a line. What I did was I selected the line & fired the Replace "^" with "#" (with Regular Expression box checked) command. Now I have two concerns -
1. The Replace dialog didn't have any option which works only on selection. That's the most desirable thing to have. Please include it.
2. Nonetheless assuming the replace dialog will replace the whole file ..it came out with Text "^" not found error. Strange !!Tags: None
Leave a comment: