DEV Community

Discussion on: Daily Challenge #103 - Simple Symbols

Collapse
 
edreeseg profile image
Ed Reeseg • Edited

I've never been the best with Regex, but here's a possible attempt:

JavaScript

const acceptableSequence = str => !/(?<!\+)\w|\w(?!\+)/.test(str);

EDIT: Misread the requirements, don't need to account for end and beginning of line characters as exceptions.