My Favorite Question
This is the question I had the most fun answering so far. It's a simple but really effective regex technique that can be used in a surprisingly large number of situations.
Tricks / Answers I had fun with
- Match Any English ASCII Character Including Special Characters
- What's in a
$? It depends!
- Matching between Variable Delimiters: Use a Conditional
- One Set of Parentheses, One Group Number: Branch Reset
- At which position in the string did the regex fail?
- Match all possible groups of one to four words
and friends: So you thought matching brackets was easy?
- Match Partially Duplicated lines
- Refactor a Regex with Subroutines
- Regex for nested (overlapping) matches
- Regex Calculators (RPN and non-RPN)
- Match the last group of (potentially) nested brackets
- Reverse-engineer regex pattern to find number of tokens and length of expected matches
- Replace Match with the Number of the Line where it was Found
- Extract All Unique Lines
- Matching French letters
- Capturing Two Optional Groups that Can Occur in Either Order
Answers I loved reading
- What's a number?
- Replacing accented characters
- Options for Forced Failure (ignore the accepted answer). This is just for fun—the standard is
(*F)in Perl and PCRE.
Work in progress—I really want to add more here. By far the greatest thrill I get on Stack is when I read an answer that makes me go "Aha!..." and grasp a way of doing things that is so much more efficient than anything I had come up with. I've been blown away quite a few times. And one thing that's for sure is there's no shortage here of people who are a lot brighter than me. :)
California, Australia or NZ
Member for 3 years, 8 months
0 profile views
Last seen Nov 9 '17 at 4:33
- Stack Overflow 38.4k 38.4k 88 gold badges7676 silver badges9898 bronze badges
- Super User 458 458 22 silver badges1313 bronze badges
- Ebooks 391 391 22 silver badges66 bronze badges
- Gardening & Landscaping 301 301 11 silver badge33 bronze badges
- English Language & Usage 291 291 22 silver badges88 bronze badges
- View network profile
Top network posts
- 222 Regex Match all characters between two strings
- 211 Regex Pattern to Match, Excluding when... / Except between
- 71 Match non printable/non ascii characters and remove from text
- 66 Regex to match all instances not inside quotes
- 65 Expression to remove URL links from Twitter tweet
- 43 How to truncate the time on a datetime object?
- 40 Why can't you use repetition quantifiers in zero-width look behind assertions?
- View more network posts →
Keeping a low profile.
This user hasn't posted yet.
Nov 9 '17