positions.js 367 B

123456789101112131415161718
  1. var types = require('./types');
  2. exports.wordBoundary = function() {
  3. return { type: types.POSITION, value: 'b' };
  4. };
  5. exports.nonWordBoundary = function() {
  6. return { type: types.POSITION, value: 'B' };
  7. };
  8. exports.begin = function() {
  9. return { type: types.POSITION, value: '^' };
  10. };
  11. exports.end = function() {
  12. return { type: types.POSITION, value: '$' };
  13. };