Javascript Regex to match standalone S without matching apostrophe S -


i trying match stand alone s ignoring case. not want match s preceded apostrophe. current regex /\b[s]\b/ig , test string , s on lines 2 , 3 should matches.

men's s s things somethings 

regexr: http://regexr.com/3geo2

after short experimentation have came following regex

(?:\s|^)s(?:\s|$) 

demo


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -