being a n00b when it comes to reqular expressions I could do with some help when it comes to conditional string replacement/deletion.
i'm trying to match a string with a word in the middle that could vary. if there is a match then i'd like to remove the end bit after the varying word.
i.e.
the text in orange is what i'd like to remove.
however my problem comes when it comes to removing the toString() bit - I'm not sure how to do it so that I also keep the text in green.
can anyone help please?
thanks in advance!
i'm trying to match a string with a word in the middle that could vary. if there is a match then i'd like to remove the end bit after the varying word.
i.e.
the text in green is the varying string. i can match it using:msg.setEventType(EventType.OPEN_DOOR.toString()
Code:
(setEventType\()(EventType\.).*(toString\(\))
the text in orange is what i'd like to remove.
however my problem comes when it comes to removing the toString() bit - I'm not sure how to do it so that I also keep the text in green.
can anyone help please?
thanks in advance!

Last edited: