Questions tagged [parsing]

Use this tag for code that parses its input, or that is source for a parser generator such as yacc or lex.

Filter by
Sorted by
Tagged with
2 votes
1 answer
179 views

Processing lexical analyses of sentences using the Perl split function

I have two kinds of lexical analyses of sentences that I need to process. One type of data comes in a "tagged" format, and the other comes in a "parsed" format. Tagged The input (...
Jon's user avatar
  • 185
4 votes
1 answer
416 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: ...
Prix's user avatar
  • 165
6 votes
3 answers
494 views

Is there any way to improve (shorten) this F# code?

I have a very good grasp of the syntax and features of F# as well as some of the concepts that mesh well with the language. However, I do not have enough experience writing it to feel comfortable that ...
user avatar
13 votes
4 answers
59k 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 ...
jzd's user avatar
  • 373
7 votes
2 answers
2k views

Slow-running File parser

I've got a method that parses a file. I take all the words and add them to a SortedSet. Every word contains a list of Lines ...
Pete's user avatar
  • 173
4 votes
1 answer
789 views

Parsing random phrases from a file

This essentially reads a specially-structured file from the scanner and then parses random phrases and prints them: ...
Mr_CryptoPrime's user avatar
4 votes
1 answer
324 views

Parse the phone balance from the operator site

How can I write this code better? ...
user avatar
2 votes
3 answers
518 views

Extracting and mangling a parameter from a MySQL configuration file

Is there a better way of doing this? ...
krunal shah's user avatar
7 votes
2 answers
850 views

Scripting language parser

I'm making a scripting language parser and it's shaping up well but it takes about 30ms to do 30 or so odd/even checks. Profiler tells me that it's taking most of ...
Darwin's user avatar
  • 376
4 votes
3 answers
1k views

73 Lines of Mayhem - Parse, Sort and Save to CSV in PHP CLI

Inside of a folder named txt I have 138 text files (totaling 349MB) full of email addresses. I have no idea (yet) how many addresses there are. They are separated ...
65Fbef05's user avatar
  • 399
5 votes
1 answer
189 views

Substitution of different occurrences of a string with changing patterns

I need to parse an invalid JSON string in which I find many repetitions of the same key, like the following snippet: ...
Andrea Spadaccini's user avatar
7 votes
1 answer
3k views

Parser for CNF formulas

I have a parser for CNF formulas in Dimacs format, which is very slow. Any suggestion on how to improve its speed? I did some profiling and I might have to replace ...
Alexandru's user avatar
  • 409
14 votes
4 answers
2k views

LL(1) tokenizer for LISP

I am trying to write a LISP interpreter in C#, so I started with a tokenizer. I haven't finished it yet (have to handle floating point numbers & symbols), but I already rewrote it two times ...
Daniil's user avatar
  • 281
16 votes
1 answer
3k views

House number parsing

I have 2 functions used for parsing a house number and I think these can both be improved. Any suggestions? input: 45a - 47b or ...
thedev's user avatar
  • 817
31 votes
6 answers
84k views

Parsing console application arguments [closed]

In our console app, the parsing of application arguments is done like so: ...
frennky's user avatar
  • 449
7 votes
3 answers
504 views

Javascript Object Placement / String Parsing Method

This JS function is intended to retrieve or place a value into an object with the nested keys as a string. For example ...
Zack Bloom's user avatar
9 votes
1 answer
747 views

Parsing a game file

Note: This file is out of my hands. I cannot change the format or type of file I have to parse. Here is some sample data that I'm trying to parse. This is information for just one player: ...
user avatar
17 votes
7 answers
2k views

Parsing a file for a game

Is this code good enough, or is it stinky? ...
user avatar
14 votes
2 answers
920 views

HTTP request path parser

I have written a method to tokenize HTTP request paths such as /employee/23/edit: ...
Jeremy's user avatar
  • 539

1
23 24 25 26
27