For example, consider Javascript object document.I wish to replace the string "document." with "doc." such that:
Since Javascript does not support look behind regex please suggest an alternative
Though originally posted as a comment, I'll allow myself to post my solution once again as an answer, because I don't want this question to hang somewhere as "open". Also, initially I thought that someone would come with a better solution in a second, but apparently it never happened, so there you go:
([^\w.])document(?=[^\w]|\b)
and replace with
$1doc
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.