What I’m trying to do
I’d like to have a base that lists broken links, excluding those that match a regex.
I can get all broken links with:
uncreated links: file.links.filter(!value.asFile().isTruthy())
But I can’t for the life of me figure out how to exclude broken links based on a regex.
Things I have tried
I’ve read the official doc and done lots of google searches, but I can’t find anything useful.
Can someone help?
dawni
3
file.links.filter(!value.asFile().isTruthy() && /your regex/.matches(value))
Replace your regex with your regex pattern. Keep the opening and closing slashes /.
Excellent; that worked.
I did have to add a ! to the start of the regex cuz I wanted hits that did NOT match the regex.
I appreciate you help @dawni !
system
Closed
5
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.