diff --git a/README.md b/README.md index 051a6a8..c9341a2 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Search for processes by name, command, or PID. Search for multiple things at once by separating them with commas. For example, `arm, x86` will return processes having `arm` or `x86` as a substring of the name or command. You can use regular expressions too. For example, `d$` will return a list of daemons (which tend to end in the letter `d`), while - `(\w+)\.\w+` will return a list of processes with reverse domain name notation, such as `com.docker.vmnetd`. + `^(\w+\.)+\w+$` will return a list of processes with reverse domain name notation, such as `com.docker.vmnetd`. - 📌 Pin important processes - 🛠 Process management (kill processes) diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index e99026b..accfa57 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -68,7 +68,13 @@ const nameSubstringMatch = process.name .toLowerCase() .includes(term.toLowerCase()); - const nameRegexMatch = new RegExp(term, "i").test(process.name); + const nameRegexMatch = (() => { + try { + return new RegExp(term, "i").test(process.name); + } catch { + return false; + } + })(); const commandMatch = process.command .toLowerCase() .includes(term.toLowerCase());