0

Regex Equivalent of "word1ASTERISKword2", where word1 is the start of a sentence, word2 is the end of the sentence, I use this "word1ASTERISKword2" in MS Excel.

I want to know that is the regex match to this?. I have already tried ^word1(.*)word2$. Not working.

PM 77-1
  • 12,933
  • 21
  • 68
  • 111
  • 1
    Maybe this would help: [Match all characters between two strings](https://stackoverflow.com/questions/6109882/regex-match-all-characters-between-two-strings) – Ori Jul 01 '22 at 16:15
  • Please [edit] your question to explain what "*Not working*" means. – PM 77-1 Jul 01 '22 at 16:18
  • You could use some looking around. `(?<=` looks behind and `(?=` looks ahead. `(?<=word1).*(?=word2)` – VvdL Jul 01 '22 at 16:20

0 Answers0