Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pattern-compile.js 574B

12345678910111213141516171819202122232425
  1. module.exports = patternCompile
  2. function patternCompile(pattern) {
  3. var before
  4. var after
  5. if (!pattern._compiled) {
  6. before = pattern.before ? '(?:' + pattern.before + ')' : ''
  7. after = pattern.after ? '(?:' + pattern.after + ')' : ''
  8. if (pattern.atBreak) {
  9. before = '[\\r\\n][\\t ]*' + before
  10. }
  11. pattern._compiled = new RegExp(
  12. (before ? '(' + before + ')' : '') +
  13. (/[|\\{}()[\]^$+*?.-]/.test(pattern.character) ? '\\' : '') +
  14. pattern.character +
  15. (after || ''),
  16. 'g'
  17. )
  18. }
  19. return pattern._compiled
  20. }