In my code, I am using the following regular expression:
var re = new RegExp("(^|\\s)" + classname + "(\\s|$)");
I know that \s represents a white-space character and the caret symbol denotes the "beginning with". However, I am confused about the pipe character in this expression...
Can someone please explain how the above expression can be interpreted in English?
Thank you,