How can we extract the words from a string in rubular expression?
$0Public$robotics00$india0$000facebook
If we want to extract the words Public robotics india facebook from the above string, how can we?
I am using ([^0$]), but it is giving the letters not the proper words.
You can match
$followed by optional zeroes, and use a capture group to match the characters other than$0or a whitespace charExplanation
\$Match a$char0*Match optional zeroes(Capture group 1[^0$\s]+Match 1+ times any char except0$or a whitespace char)Close group 1Regex demo
Output