Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Posts tagged regex

Use this tag for questions concerning use of regular expressions (AKA "regex" or "RegExp"). It's highly recommended to also mention the programming language and/or tools you're using, because there are many different "flavors" of regex and answers in one language will not necessarily work in another.

This tag doesn't have a detailed wiki yet.

66%
+2 −0
Q&A Advanced Regex extension for VS Code

VS Code supports regex search, but the search/replace is UI is just a tiny dialog box. It's okay if you know regex well and the expression is not complex, but when trying to apply complicated expre...

0 answers  ·  posted 6mo ago by matthewsnyder‭

50%
+3 −3
Q&A Regex for simplifying Amazon product URLs

Amazon product URLs are often very long, but on experimentation it is revealed that the following pattern is sufficient: https://www.amazon.com/{dp|gp}/$ID ID is a 10-char string, which I'm gue...

1 answer  ·  posted 6mo ago by matthewsnyder‭  ·  last activity 6mo ago by mr Tsjolder‭

Question regex url
85%
+10 −0
Q&A Vim: how to search for all instances of a string, except for those that are between two specific strings

Using Vim, I am trying to search for all instances of a specific string, except for those that fall somewhere in between two other specific strings. For example, I want to determine all instances ...

2 answers  ·  posted 2y ago by Trevor‭  ·  last activity 2y ago by Dirk Herrmann‭

85%
+10 −0
Q&A What does the "\s" shorthand match?

I've seen some regular expressions (regex) using \s when they want to match a space, but I noticed that it also matches line breaks. Example: the regex [a-z]\s[0-9] (lowercase ASCII letter, follow...

1 answer  ·  posted 3y ago by hkotsubo‭  ·  last activity 2y ago by hkotsubo‭

Question regex whitespace
80%
+6 −0
Q&A Python Regex to parse multiple "word. word. word."

I'm trying to parse lines like "THIS. THAT..OTHER " so that "THIS. THAT." is found. There can be more than one <word><dot> separated by a space except no space after the last one. ...

2 answers  ·  posted 3y ago by CodeFarmer‭  ·  last activity 2y ago by hkotsubo‭

Question python regex
83%
+8 −0
Q&A How can I emulate regular expression's branch reset in Java?

I've got this sample regex: Pattern p = Pattern.compile("(?:([aeiou]+)[0-9]+|([123]+)[a-z]+)\\W+"); It basically has the following parts: one or more lowercase vowels ([aeiou]+), followed by one ...

2 answers  ·  posted 3y ago by hkotsubo‭  ·  last activity 3y ago by hkotsubo‭

Question java regex
77%
+5 −0
Q&A How to match standard email addresses with regex?

I want to match standard email syntax (lowercased English, numbers and perhaps also some hyphens and underscores) with regex for a sed operation that matches and changes a single email address insi...

1 answer  ·  posted 3y ago by deleted user  ·  last activity 3y ago by hkotsubo‭

Question regex email sed
66%
+4 −1
Q&A How can I write an egrep (grep -E) regexp that matches lines containing two stanzas in arbitrary order?

I have line-based data on the form x1=y2; a3=b4; c5=d6; ... Matching this with a extended regular expression is fairly straightforward; for example, one can do something not entirely dissimilar...

3 answers  ·  posted 3y ago by Canina‭  ·  last activity 3y ago by hkotsubo‭

Question regex grep
66%
+2 −0
Q&A How do I configure Jenkins to strip the leading “origin/” in git branch parameter?

I'm using Jenkins with a branch parameter to specify the branch to build from. Other stuff downstream needs the branch name to not have the leading "origin/" -- just "feature/blahblah" or "bugfix/1...

1 answer  ·  posted 3y ago by Monica Cellio‭  ·  last activity 3y ago by Monica Cellio‭

Question regex git jenkins
86%
+11 −0
Q&A Can regex be used to check if input conforms to a very strict subset of HTML?

Tldr; I don't need to parse HTML, but I need to check if user submitted input conforms to a very strict subset of HTML. Can regex be a suitable tool for this? Details I have a frontend sanitiser th...

4 answers  ·  posted 3y ago by jla‭  ·  last activity 3y ago by Stephen C‭

Question javascript regex html