in reply to problem using regexp

The first match eats up the space. The second 'a' therefore is not matched, because there is no space before it. If you do not want the space to be eaten, you can use a look-around:
/\s(a)(?=\s)/ig

Replies are listed 'Best First'.
Re^2: problem using regexp
by artifact (Novice) on Jul 29, 2012 at 16:01 UTC
    thanks ,it works!!