Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Fix RegExp used to remove existing line classes #15

merged 2 commits into from

2 participants


It previously looked for zero or more space characters (\s*) before the LINE_CLASS_PREFIX, which could have caused it to also match other classes irrelevant to BigText. To prevent that, now it matches either the beginning of the line (^) or one or more space characters (\s+).


Actually it should just be checking for word boundaries... Added a new commit to fix that.

@zachleat zachleat merged commit 05a27ec into zachleat:master

Works great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 30, 2011
  1. @frangio
Commits on Dec 31, 2011
  1. @frangio

    Fix RegExp for real this time

    frangio authored
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  bigtext.js
2  bigtext.js
@@ -111,7 +111,7 @@
$t.find(childSelector).addClass(function(lineNumber, className)
// remove existing line classes.
- return [className.replace(new RegExp('\\s*' + BigText.LINE_CLASS_PREFIX + '\\d+'), ''),
+ return [className.replace(new RegExp('\\b' + BigText.LINE_CLASS_PREFIX + '\\d+\\b'), ''),
BigText.LINE_CLASS_PREFIX + lineNumber].join(' ');
Something went wrong with that request. Please try again.