I Want to Find string ,whose last character may or may not present
"abc,efg,ASD"
"abc,ASD,efg"
so, i have to find ASD with or without " , "
[,"](ASD)[,"]

This regular expression will do the following:
Live Demo
https://regex101.com/r/mV9vA9/1
NODE EXPLANATION
----------------------------------------------------------------------
[,"] any character of: ',', '"'
----------------------------------------------------------------------
( group and capture to \1:
----------------------------------------------------------------------
ASD 'ASD'
----------------------------------------------------------------------
) end of \1
----------------------------------------------------------------------
[,"] any character of: ',', '"'
----------------------------------------------------------------------
str.match(/\bASD\b/g)?ASDfrom the first string, andASD,from the second. The criteria are not clear: get all non-word chars after ASD but whitespace (/\bASD[^\w\s]*/)? Or an optional comma (/\bASD,?/)?