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

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -