RegEx expression not valid on CodePen

RegEx expression not valid on CodePen


I’m using a RegEx expression in my code that CodePen deems to be invalid (even though it actually works): /(?<=:)\d+/

Does anyone know a way around this?

The codepen in which I’m using it is here (line 114):

Thank you!


I don’t know why your regex is failing (not a regex guru), but you might try /\d+$/ just capturing the number from the end of the string.

Also, there are problems in your codepen. In codepen, you don’t load all those things in the HTML. You’re HTML should only be the things between the body tags, not including the body tags. Everything else is handled by codepen or loaded by you in the codepen setup. For example, your line

<link rel="stylesheet" href="pomodoro2.css" />

is throwing an error in your console because codepen has no idea where that file is:


Codepen can’t load local files.


Thank you so much! That regex expression is definitely way simpler and equally does the job!

Yeah, I forgot to remove those things. I edited the files in Brackets originally. Thanks again :slight_smile: