Tagged Questions
10
votes
4answers
9k views
Simplify splitting a String into alpha and numeric parts
Requirement: Parse a String into chunks of numeric characters and alpha characters. Alpha characters should be separated from the numeric, other characters should be ignored.
Example Data:
Input ...
7
votes
5answers
557 views
Reading from text file with RegexMatch
Below is the method that I have written for reading from a text file. While reading, I need to match line string to given regex and if it matches then I need to add the line string to a collection.
...
7
votes
3answers
98 views
VB6/VBA Declaration (Dim) Syntax Parser
As part of a project I'm working on, I've implemented a class that encapsulates the syntax for a vb6/vba Dim statement.
Given a line of code, the ...
7
votes
1answer
274 views
HTTP Authorization header parser
I'm writing a parser for HTTP Authorization header (see RFC2616#14.8 and RFC2617#1.2). Note that I explicitly don't care about the base64-encoded syntax used by HTTP Basic authentication. I'm only ...
6
votes
2answers
77 views
Performance tuning on a text file to object conversion
I'm using an API which returns text in the following format:
...
4
votes
1answer
239 views
Regex parser - request for review and optimization
The whole question is Better implementation of a simplified regular expression engine?.
I have solved the question, and in turn felt the need to get it reviewed. Any suggestions for clean up and ...
4
votes
2answers
62 views
Packaging a single-file Python copy-tool
I'm currently working on a very simple one-file project:
Lumix provides the possibility for the camera TZ41 (and others) to load GPS data and tourist information from a DVD to a SD-card so that you ...
4
votes
1answer
106 views
Is my PHP script/embed remover robust?
The goal of this question:
Your goal here is to find a security hole in my code which allows a user to create input that contains a script doing anything they want, without that script being stopped ...
4
votes
1answer
177 views
Using Regex to parse a chat transcript
I need to classify each line as "announce, whisper or chat" once I have that sorted out I need to extract certain values to be processed.
Right now my regex is as follow:
...
3
votes
2answers
103 views
3
votes
2answers
167 views
Parsing HTTP server logs
I have a relatively simple project to parse some HTTP server logs using Python and SQLite. I wrote up the code but I'm always looking for tips on being a better Python scripter. Though this is a ...
3
votes
1answer
405 views
Unicode parsing in PHP
Firstly, apologies if this is not the correct type of question for here, I had it on the stackoverflow but it was closed with a suggestion I post here.
I’m in the process of converting from Latin 15 ...
2
votes
1answer
28 views
Parsing playlists efficiently
I have this regexp working, simple, but I feel like it may not be the best way to code it. Basically, I have a playlist separated by line breaks returned as tcp data like so:
...
2
votes
1answer
45 views
Is this `img` creator decently secure from XSS?
This is being used now, seems decent to me but I'm curious.
...
1
vote
3answers
1k views
How should I read coordinates from a text file?
I have a text file with lines that look like this:
...
1
vote
1answer
127 views
Is this a safe way to parse out HTML tag attributes?
I needed a super simple parser to get HTML attributes and their values. I didn’t want to load a big library or anything so I made this.
I realize I am making assumptions here, mainly:
Attribute ...