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
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
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
Results tagged with Search options user 8478

A competition to solve a particular problem through the usage and manipulation of strings.

8
votes
Retina, 4 bytes . $` Expects the input to be terminated with a Windows-style \r\n newline (which seems fitting for a .NET-based programming language...). This can be tested on Regex Storm (which u …
answered Sep 7 '16 by Martin Ender
3
votes
Retina, 49 bytes .*?(?<=^(?=(.*)(?<4-3>.)*(.*) \2.*\1$)(.)*).+ $#4 Try it online! (Slightly modified to run all tests at once.) The trick is that we need to backtrack over the part of A that we do …
answered Apr 27 '16 by Martin Ender
1
vote
CJam, 10 bytes {S-$e`::*} An unnamed block that expects the string on top of the stack and replaces it with a list of strings. Try it online! Explanation S- Remove spaces. $ Sort. e` Run …
answered Aug 25 '16 by Martin Ender
6
votes
Wolfram Language (Mathematica), 34 bytes p#2<>p<>#&@@StringSplit[#,p,2]& Try it online! An unnamed, curried function which should be called with the pivot first and the main string second. E.g., if you assigned the function to a name f: f["-"]["1-2-3-4-5-6"] …
answered Dec 8 '17 by Martin Ender
0
votes
Retina, 25 20 bytes Byte count assumes ISO 8859-1 encoding. Om$`^.((?=.*¶))? $#1 Try it online! Input and output are linefeed-separated. The test suite performs the necessary I/O conversion from …
answered May 24 '17 by Martin Ender
5
votes
Mathematica, 95 94 79 bytes Cases[Tally@StringCases[#,___,Overlaps->All],{s_,1}:>s]~MinimalBy~StringLength& StringCases gets me all possible substrings, the Tally and Cases filter out those that ap …
answered Jan 27 '15 by Martin Ender
2
votes
Retina, 36 bytes Byte count assumes ISO 8859-1 encoding. i`(?<=^.*\b\2(\w+)[^·]*?(\w)) $1 A1` Try it online!
answered Jun 7 '16 by Martin Ender
4
votes
CJam, 7 bytes q~S/%S* Test it here. This reads a number and a string (in that order) from STDIN. Explanation q~ e# Read and eval input. S/ e# Split on spaces. % e# Take every Nth element. S* e# Join the words back together with spaces. …
answered May 21 '15 by Martin Ender
6
votes
characters in matching positions from those two e# strings. E.g. "ab!" "AB!" would give ["aA" "bB" "!!"]. e# For each character from the original string and the corresponding .| e … # string from this list, take the set union (which eliminates duplicates e# and keeps the order the values appear in from left to right, so that e# the original case of each letter comes first). …
answered Jul 8 '16 by Martin Ender
7
votes
CJam, 26 24 20 bytes 4 bytes saved thanks to Peter. l~:I*{_'_/[\]zsI<}I* Test it here. Takes the string first and n second on STDIN. You can run all test cases by pasting them into the input as … output."; { }I* "Repeat this block n times. This will always be enough passes."; _ "Duplicate the string."; '_/ "Split the string on …
answered Feb 2 '15 by Martin Ender
5
votes
Mathematica, 63 bytes "I love"["I hate"][[#~Mod~2]]&~Array~#~Riffle~" that "<>" it."&
answered Aug 31 '16 by Martin Ender
13
votes
. Now group 1 is what we want to replace the match with if it is a digit - if it is a letter we want to replace it with twice this string. That's where the second lookbehind comes into play: (?<=(\1 …
answered Oct 27 '15 by Martin Ender
10
votes
> } on the right or < [ ( { on the left. We match those with .+[])D3>}]|[<[({].+ and replace them with happy. If we didn't match there will be two or three characters in the string (the emoticon), but …
answered Sep 12 '15 by Martin Ender
10
votes
Retina, 29 bytes !ms`^(.+?)(?!.+^\1)(?<!^\1.+) Input and output are linefeed-separated lists of strings. Try it online! (Test suite with comma-separation for convenience.) Explanation This simpl …
answered Mar 18 '17 by Martin Ender
13
votes
: T`'\` Remove apostrophes and backticks. S_`\W|_|(?<=[a-z])(?=[A-Z][a-z]) Split the string around non-word characters (in regex this also excludes digits and underscores), or underscores or … important at the beginning of the string. We get rid of those with the _ option. Here, "splitting" means put each remaining part on its own line. T`L`l Convert everything to lower case. T`l`L …
answered Mar 2 '16 by Martin Ender

15 30 50 per page