{"library":"lodash._reinterpolate","title":"Lodash reInterpolate Regex Module","description":"lodash._reinterpolate is a specialized, internal standalone module designed to expose the regular expression used by Lodash's templating engine for identifying and extracting interpolation delimiters (e.g., `<%= variable %>`). This package is strictly versioned at 3.0.0, aligning it with the Lodash v3 major release. As such, it has not received updates since its initial publication and is considered abandoned for direct consumption in contemporary JavaScript development environments. While the underlying `reInterpolate` regex pattern remains integral to the actively maintained `lodash` (currently v4.18.1) and `lodash-es` distributions' `_.template` function, developers are strongly advised against directly importing or relying on `lodash._reinterpolate`. Instead, the recommended approach is to leverage the robust and publicly exposed `_.template` method from the main Lodash library, which encapsulates and manages this internal logic.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install lodash._reinterpolate"],"cli":null},"imports":["const reInterpolate = require('lodash._reinterpolate');","import _ from 'lodash';\nconst compiled = _.template('Hello <%= user %>!');","import template from 'lodash/template';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const reInterpolate = require('lodash._reinterpolate');\n\n// The reInterpolate regex is designed to match default Lodash interpolation delimiters.\n// For example, it finds content within <%= ... %>.\nconst templateContent = 'User ID: <%= user.id %>\\nName: <%= user.name.toUpperCase() %>\\nLocation: <% location %>';\n\nlet match;\nconst matches = [];\n// Use a global regex to find all matches\n// Note: reInterpolate itself is not global, so we create a new global instance.\nconst globalReInterpolate = new RegExp(reInterpolate.source, 'g');\n\nwhile ((match = globalReInterpolate.exec(templateContent)) !== null) {\n  // match[0] is the full matched string (e.g., '<%= user.id %>')\n  // match[1] is the content inside the delimiters (e.g., 'user.id')\n  matches.push({ full: match[0], content: match[1] });\n}\n\nconsole.log('Detected interpolation tokens:');\nmatches.forEach(m => console.log(`Full Match: '${m.full}', Content: '${m.content}'`));\n\n// In a real scenario, this regex is used internally by _.template.\n// For modern usage, you'd use lodash.template directly:\n// const _ = require('lodash'); // or import _ from 'lodash';\n// const compiled = _.template('Hello <%= user.name %>!');\n// console.log(compiled({ user: { name: 'World' } }));","lang":"javascript","description":"Demonstrates importing the `reInterpolate` regex and how it identifies interpolation patterns within a string, highlighting its internal role in Lodash's templating engine. This raw regex is used by the `_.template` function.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}