Re: Regular Expression Thickness Again

  • From: "Octavian Rasnita" <orasnita@xxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Thu, 1 Nov 2007 19:17:10 +0200

Yes, you understood correctly.

If you are using

[example]

it won't match the word example, but a single letter that can be any of the e, x, a, m, p, and l.

Octavian

----- Original Message ----- From: <james.homme@xxxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Thursday, November 01, 2007 6:09 PM
Subject: Re: Regular Expression Thickness Again


Hi Teddy,
Are you saying that I need to remove the brackets to match either the word
function or the word script? Are you also saying that with the brackets, I
would be matching those letters anywhere in the whole line? That's it. I'm
going to get that regular expressions book I saw in one of those
collections Jamal has. I'm determined to learn this the right way.

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




            "Octavian
            Rasnita"
            <orasnita@xxxxxxx                                          To
            om>                       programmingblind@xxxxxxxxxxxxx
            Sent by:                                                   cc
            programmingblind-
            bounce@freelists.                                     Subject
            org                       Re: Regular Expression Thickness
                                      Again

            11/01/2007 11:58
            AM


            Please respond to
            programmingblind@
              freelists.org






Hi,

You've used a character class (between [ and ]. Don't use character
classes,
because it will match everything that contains a character from that class.



Octavian

----- Original Message -----
From: <james.homme@xxxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Thursday, November 01, 2007 3:15 PM
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



__________
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: