regex pattern

Want to match only .md files but not .skip.md files. Any idea of making such regex pattern. Thanks.
13 Replies
JavaBot
JavaBot8mo ago
This post has been reserved for your question.
Hey @webbdays! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
0x150
0x1508mo ago
^.*?(?<!\.skip)\.md$
No description
webbdays
webbdaysOP8mo ago
thanks. can you explain it.
JavaBot
JavaBot8mo ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
webbdays
webbdaysOP8mo ago
any other way of doing it. another pattern
Kyo-chan
Kyo-chan8mo ago
In theory sure, but that will be a monster That sort of things aren't really for regex when it starts being complicated or if you don't want negative backward groups
0x150
0x1508mo ago
^ match start of input
. match any character
*? match previous token any amount of times, expanding as needed (lazy). you can remove the ?, it is not needed here
(?<! negative lookahead, aka "assert that the pattern in this group does not match
\.skip ".skip"
) close negative lookahead
\.md ".md"
$ match end of input
^ match start of input
. match any character
*? match previous token any amount of times, expanding as needed (lazy). you can remove the ?, it is not needed here
(?<! negative lookahead, aka "assert that the pattern in this group does not match
\.skip ".skip"
) close negative lookahead
\.md ".md"
$ match end of input
JavaBot
JavaBot8mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
webbdays
webbdaysOP8mo ago
Thanks.
JavaBot
JavaBot8mo ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
webbdays
webbdaysOP8mo ago
i trying to avoid that lookahead thing. because, i am dealing with std regex in rust. in which its not supported. actually pattern is for datatest-stable. which is a test runner per file. datatest-stable uses std regex. so here is the problem. any other alternatives for datatest-stable which should give stability guaranties. not nightly. sorry its java server, but if any idea let me know.
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
JavaBot
JavaBot8mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Want results from more Discord servers?
Add your server