
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
pattern-grab
Advanced tools
🤛🏻 Regular Expression Data Grabber
Pattern-grab simplifies the process of parsing string patterns using regular expressions.
npm i pattern-grab
import patternGrab from 'pattern-grab'
// Data
const regex = /<[^>]*>/gm
const string = `<span>Yup This is a <b>Test</b> Yea <img src="/blabla.png" /> Its Ok?</span>`
// Pattern Grab
const { data, positions } = patternGrab({ regex, string })
// The HTML tag strings are grabbed.
data === [
"<span>",
"Yup This is a ",
"<b>",
"Test",
"</b>",
" Yea ",
'<img src="/blabla.png" />',
" Its Ok?",
"</span>",
];
// Actually matched elements position are grabbed.
positions === [0, 2, 4, 6, 8]
// It is easy to handle because it is placed with other strings.
data.forEach((element, index) => {
if(positions.includes(index)){
// HTML Tag
} else {
// Plain text
}
})
<script src="https://cdn.jsdelivr.net/npm/pattern-grab/export/pattern-grab.js"></script>
var patternGrab = window.patternGrab
// Pattern Grab
var grab = patternGrab({
regex: /<[^>]*>/gm,
string: `<span>Yup This is a <b>Test</b> Yea <img src="/blabla.png" /> Its Ok?</span>`
})
// The HTML tag strings are grabbed.
grab.data == [
"<span>",
"Yup This is a ",
"<b>",
"Test",
"</b>",
" Yea ",
'<img src="/blabla.png" />',
" Its Ok?",
"</span>",
];
// Actually matched elements position are grabbed.
grab.positions == [0, 2, 4, 6, 8]
// It is easy to handle because it is placed with other strings.
for(index in grab.data){
var element = grab.data[index]
if(grab.positions.indexOf(index) != -1){
// HTML Tag
} else {
// Plain text
}
}
MIT Licensed.
FAQs
🤛🏻 Regular Expression Data Grabber
The npm package pattern-grab receives a total of 2 weekly downloads. As such, pattern-grab popularity was classified as not popular.
We found that pattern-grab demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.