I need to replace [email protected]|
or sam[email protected]|
to
''
(empty strings).I have written following regex but its unable to deal
with .
-
emptyspace
in the strings.
my regex is \[email protected]["|"]
now question is how to include .
, empty space
,-
along with alpha numeric characters
my final output should be : [email protected]|
to ``
Add the character you want to match in a character class [\w.-].
In you example you want to match piramal
and in your regex you want to match ongoose
. To match both of them you might use an alternation (?:ongoose|piramal)
or match any non whitespace character using \S+
and replace with an empty string.
To match a dot you have to escape it \.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments