Re: Regular Expression Thickness Again

  • From: Jamal Mazrui <empower@xxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Thu, 1 Nov 2007 13:09:25 -0500 (EST)

I looked into this and suggest the following steps with EdSharp.

Since BuiltIn.jsd does not contain ":script" entries, I appended
Default.jsd to a temporary document so there would be both ":function"
and ":script" entries.  Since the Replace with Regular Expression
command is case-sensitive, but the regular replace is not, I globally
replaced ":function" with the same string, and likewise for ":script" so
that differences in case would not affect the subsequent work with
regular expressions.

For the regular expression search pattern, try

^:((function)|(script)) *(.*)$

For the substitution, try

:$4 $1

The .NET 2.0 documentation at
http://www.EmpowermentZone.com/net20doc.zip
contains material on .NET regular expressions in the file
Development Fundamentals.txt

Hope this helps,
Jamal

On Thu, 1 Nov
2007
james.homme@xxxxxxxxxxxx wrote:

> Date: Thu, 1 Nov 2007 09:15:56 -0400
> From: james.homme@xxxxxxxxxxxx
> Reply-To: programmingblind@xxxxxxxxxxxxx
> To: programmingblind@xxxxxxxxxxxxx
> Subject: Regular Expression Thickness Again
>
>
> Hi,
> I put builtin.jsd into EdSharp. I want to swap the first word on every line
> with the rest of the line if that line begins with either the word function
> or the word script.
>
> My search expression is this.
> (^[function|script])(.*$)
>
> My replacement expression is this.
> \2\1
>
> When I execute the replacement operation, the whole line disappears. What
> did I do wrong?
>
> Thanks.
>
> Jim
>
> James D Homme, , Usability Engineering, Highmark Inc.,
> james.homme@xxxxxxxxxxxx, 412-544-1810
>
> "Never doubt that a thoughtful group of committed citizens can change the
> world.  Indeed, it is the only thing that ever has." -- Margaret Mead
>
> __________
> View the list's information and change your settings at
> //www.freelists.org/list/programmingblind
>
__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts: