← Back to challenges

RegEx: Boundary Assertions III

JavaScriptHardformattingregexvalidation

Instructions

Write a regular expression that ensures the word "end" is inside of another word (e.g. "bending"). Non-word characters such as !, ?, etc. cannot be boundaries.

Examples

"The end of the story." ➞ false
"Endings are pointless." ➞ false
"Let's send!" ➞ false
"We viewed the rendering at the end." ➞ false
"Sometimes bending the rules is good." ➞ true

Notes

  • You cannot use \w, *, . or + in your expressions.
  • You don't need to write a function, just the pattern.
  • The expression should be case-insensitive and should check all occurences of "end".
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Determine If Two Numbers Add up to a Target Value