I am having a difficult time with these sets of inputs and outputs:
input: so sh [/] she had a [^ wheee] .
output: so sh [/] she had a .
input: aah [!] [^ makes sound effects] .
output: aah.
input: and she say (.) I got it [^ repeats 2 times] .
output: and she say (.) I got it .
input: oh no[x 3] .
output: oh no.
input: xxx [^ /bosolasafiso/]
output: xxx
input: hi [* med]
oupt: hi [* med]
I have used REGEX but no use, I need exact conditions to make all these satisfy and the resultant output should be returned.
All the "INPUTS" are being read from a file so please be noted that even if i use "split()" the words like [^ whee] will be treated as two different words.
I need a condition where only words that contains [/] [* should be retained.
other words that starts with "[" should be replaced with an empty string.
[/X]and[*X]with a placeholder of your choice (say,{/X}and{*X}), then replace all[Y]with an empty string, and finally replace the curly braces with square brackets again.