- Find all references to filenames ending in
.js
:[^ ]+\.js
- Find all blank lines:
^\r?\n\r?
- Wildcard (any character and newlines):
(.|\n)+?
- Eg find all
<td>
s, regardless of content:<td>(.|\n)+?</td>
- Include attribute(s):
<td(.|\n)+?>(.|\n)+?</td>
- Include attribute(s):
- Eg find all
- Convert
getComputedStyle(foot1).left
tofoot1.getBoundingClientRect().x
: findgetComputedStyle\((.+?)\).left
and replace it with$1.getBoundingClientRect().x
- Remove all
<a>
tags, leaving just the anchor tag text: find<a[^>]*>(.*?)</a>
and replace with$1
- Only links that start with the string
/foo
:<a href="/foo[^>]*>(.*?)</a>
- Only links that start with the string
- Find all URLs:
\b(https?):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]
- All URLs ending in
.jpg
:\b(https?):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|](\.jpg)
- All URLs ending in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Reactive UI with Proxy object</title> | |
</head> | |
<body> | |
<!-- Comment which got me thinking: https://news.ycombinator.com/item?id=35062021 --> | |
<p>Count: | |
<span id="count"></span> | |
</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source: ChatGPT 4 | |
function similarText(first, second) { | |
// Check for null, undefined, or empty string inputs | |
if (first === null || second === null || typeof first === 'undefined' || typeof second === 'undefined' || first.trim().length === 0 || second.trim().length === 0) { | |
return { matchingCharacters: 0, similarityPercentage: 0 }; | |
} | |
// Type coercion to ensure inputs are treated as strings | |
first += ''; | |
second += ''; |
OlderNewer