Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Regular expressions are a declarative language, mainly used for pattern matching within strings. Please include a tag specifying the programming language you are using, together with this tag.
11
votes
3
answers
4k
views
Number to Roman numerals
The next step is to translate all combinations into their correct form using regex and a translation map. The functions were written in that order and fixing the problem the last part caused. …
7
votes
3
answers
702
views
Find all needles in the haystack and return their sum
This is based on a programming challenge I recently solved. However, since the writer of the challenge asked me not to disclose the question and/or it's answer, I modified it a little. If it doesn't m …
40
votes
2
answers
2k
views
It'th wabbit theathon
I don't know regex. I want to learn regex, but learning regex just for the sake of regex would be quite boring. … How does one properly combine Ruby and (repeated) regex substitutions? …
13
votes
2
answers
5k
views
Average spam confidence
Exercise 7.2 from Python for Informatics:
Write a program to prompt for a file name, and then read through
the file and look for lines of the form:
X-DSPAM-Confidence: 0.8475
When yo …
19
votes
2
answers
599
views
Count the occurence of nucleobases in DNA string
Sample Dataset
AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC
Sample Output
20 12 17 21
Since I'm still on my quest to learn both regex and Ruby, I decided to go that route: … I'm perfectly aware regex may not be the optimal solution here, but I'd like to stick with it anyway. …
13
votes
Javascript Syntax-Highlighter for Java
There's a glaring problem with this: no user input validation.
A basic test revealed this:
Ah, but that's not Java you say? True, but what if some poor sod has a stray HTML tag in their docstring?
A …