On Oct 7, Jerry Preston said:

>  s/(?=[A-z|0-9]+)\*(?=[A-z]+)/' * '/g;

You want to change "3*foo" to "3 * foo", right?  Well then, there are a
couple problems with your regex.

First, the (?=...) at the beginning is a look-AHEAD.  You want a
look-BEHIND, and you only need to look behind for one character.  The
character class [A-z|0-9] doesn't do what you might think.  [A-z] contains
all of A-Z, a-z, but also those characters whose ASCII values are between
Z's (90) and a's (97).  The | is not used in a character class for
alternation, either.

I think the regex you want is:

  s/(?<=[A-Za-z0-9])\*(?=[A-Za-z])/ * /g;

You don't want the quotes on the right-hand side; they're not necessary.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to