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
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

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.

84%
+9 −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 8mo ago by Trevor‭  ·  last activity 8mo 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 1y ago by hkotsubo‭  ·  last activity 1y 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 &lt;word&gt;&lt;dot&gt; separated by a space except no space after the last one. ...

2 answers  ·  posted 2y ago by CodeFarmer‭  ·  last activity 1y 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 2y ago by hkotsubo‭  ·  last activity 1y 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 2y ago by deleted user  ·  last activity 2y 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 2y ago by Canina‭  ·  last activity 2y 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 2y ago by Monica Cellio‭  ·  last activity 2y 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 2y ago by jla‭  ·  last activity 2y ago by Stephen C‭

Question javascript regex html