regex - Javascript: negative lookbehind equivalent? -


is there way achieve equivalent of negative lookbehind in javascript regular expressions? need match string not start specific set of characters.

it seems unable find regex without failing if matched part found @ beginning of string. negative lookbehinds seem answer, javascript doesn't have one.

edit: regex work, doesn't:

(?<!([abcdefg]))m

so match 'm' in 'jim' or 'm', not 'jam'

use

newstring = string.replace(/([abcdefg])?m/, function($0,$1){ return $1?$0:'m';}); 

Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -