I have been trying real hard understanding regular expression,
Is there any way I can replace character(s) that is between two strings/
For example
I have
sometextREPLACEsomeothertext
I want to replace , REPLACE (which can be anything in real work) ONLY between sometext and someothertext with other string.
Can anyone please help me with this.
EDIT
Suppose, my input string is
sometext_REPLACE_someotherText_something_REPLACE_nothing
I want to replace REPLACE text in between sometext and someotherText
resulting following output
sometext_THISISREPLACED_someotherText_something_REPLACE_nothing
Thank you
If I understand your question correctly you might want to use lookahead and lookbehind for your regular expression
Thus
would match any ‘word’ with at least 1 character following ‘sometext’ and followed by ‘someothertext’
In C#: