Are you using any split or replace operation with the delimiter ? You can use : the regex - "\blight\b" on the split/replace operation and it will match with "light" and not "lightning".
You can verify/test this out @ JavaScript RegExp Example
Hope this helps.