parsing

What is Parse/parsing?

Hi Just wondering what exactly is a Parseing or parsing? especially related to Java. Why are they used? for example: Integer.parseInt, String parse.String etc Thank you ...

Using C# regular expressions to remove HTML tags

How do I use C# regular expression to replace/remove all HTML tags, including the angle brackets? Can someone please help me with the code? ...

Javascript XML parsing or alternative

I'm building a Javascript preview function for a blog back-end (much like the one used on this website), and I'd like to be able to parse some custom tags that normally get parsed by PHP. I am wondering if it's possible to use the JS XML parser to parse content from a textarea that would look like: <img=1> Use for <url=http://apwit.com...

Parsing in Ruby (on Rails)

I want to write a Rails app to assist me with my online Poker. I play on PokerStars, and there is text data available for each hand that is played. The format it comes in is this: PokerStars Game #27457662450: Tournament #157033867, Freeroll Hold'em No Limit - Level IV (50/100) - 2009/04/24 20:39:44 ET Table '157033867 830' 9-max Seat ...

JQuery if then else using URL parser plugin, there must be a more elegant solution!

Hello everyone. This is my first post on this rather spiffing website so go easy on me if this has been discussed elsewhere (I can't find it if it has). I'm using the JQuery URL parser plugin found here: http://projects.allmarkedup.com/jquery_url_parser/ I can get it to do what I want but the code is rather inefficient. I have a coll...

Writing a simple parser

I need to write a simple parser to a sort of Domain Specific Language. It needs to have basic arithmatics with proper operators evaluation order and a syntax to call functions of the underlying environment which can be overloaded. What is the simplest way to write such a parser? Is there something I can adapt or use out of the box? I'm w...

PHP text parsing and / or make your own language?

Been Googling around without finding much at all, so does anyone know of a class or library that helps you parse any sort of language, like a Domain Specific Language (I'm creating one, so I'm flexible in what the syntax and format can be) into either PHP code or some helpful struct or a class hiearchy or ... ? Anything goes at this poin...

How can I parse descriptive text to a DateTime object?

Are there any existing libraries in existence that will parse a datetime from a plaintext phrase? I'm looking for something similar to Remember The Milk or Outlook, where the user can enter "next tuesday at 6pm" or "tonight at 7" and the library can spit out {4/28/2009 18:00:00} or {4/25/2009 19:00:00}. I'm considering writing my own, bu...

How to extract image urls from HTML File in C#

Can anyone help me by explaining how to extract image urls from HTML File in C# ...

missing ] after element list parsing JSON

Executing that: $.post( "/url/to/method", { }, function(data){ var obj2 = eval("("+$(data).children()+")"); // OR var obj = $.evalJSON($($(data).children())); // Jquery-json $body = $("#AAA"); $body.html(obj.fied); }, "xml" ); while turn into a "missing ] after element list" (at row 5 or 6) error in firebug. The JSON ...

Explanation and solution for JavaCC's warning "Regular expression choice : FOO can never be matched as : BAR"?

I am teaching myself to use JavaCC in a hobby project, and have a simple grammar to write a parser for. Part of the parser includes the following: TOKEN : { < DIGIT : (["0"-"9"]) > } TOKEN : { < INTEGER : (<DIGIT>)+ > } TOKEN : { < INTEGER_PAIR : (<INTEGER>){2} > } TOKEN : { < FLOAT : (<NEGATE>)? <INTEGER> | (<NEGATE>)? <INTEGER> "." <...

Is there a grammar parser (similar to yapps for python) for C++?

Hi all, I'm writing an experimental language, which is very close to pseudocode, for fun and to learn more about C++. One of the problems is that I need to parse some grammar, and my search to find a good C++ grammar parser has been unsuccessful (I couldn't find anything). What I want to accomplish is this: set a to 4 And I want th...

Most effective way to parse C-like definition strings?

Hello all. I've got a set of function definitions written in a C-like language with some additional keywords that can be put before some arguments(the same way as "unsigned" or "register", for example) and I need to analyze these lines as well as some function stubs and generate actual C code from them. Is that correct that Flex/Yacc ...

searching strings for keywords: questions about the "failure function"

I've got a question on failure function description from "Compilers: Principles, Techniques, and Tools" aka DragonBook Firstly, the quote: In order to process text strings rapidly and search those strings for a keyword, it is useful to define, for keyword b1b2...bn, and position s in that keyword , a failure function, f (s) ... ...

How might one go about implementing a forward index in PHP?

Hello all, I am looking to implement a simple forward indexer in PHP. Yes I do understand that PHP is hardly the best tool for the task, but I want to do it anyway. The rationale behind it is simple: I want one, and in PHP. Let us make a few basic assumptions: The entire Interweb consists of about five thousand HTML and/or plain-text...

How to parse kanji numeric characters using ICU?

I'm writing a function using ICU to parse an Unicode string which consists of kanji numeric character(s) and want to return the integer value of the string. "五" => 5 "三十一" => 31 "五千九百七十二" => 5972 I'm setting the locale to Locale::getJapan() and using the NumberFormat::parse() to parse the character string. However, whenever I pass...

python method to extract content (excluding navigation) from an HTML page

Of course an HTML page can be parsed using any number of python parsers, but I'm surprised that there don't seem to be any public parsing scripts to extract meaningful content (excluding sidebars, navigation, etc.) from a given HTML doc. I'm guessing it's something like collecting DIV and P elements and then checking them for a minimum...

Is there any pre-built way to parse JSON from VB6?

Is there any existing JSON parser which can be used from VB6? I could obviously write my own parser, but I don't want to reinvent the wheel if I don't have to. Thanks! ...

Regex for set

I'd like some help for detecting the following expressions with RegEx string "(x/x)" where x is any number from 0-999. string "x of x" where x is any number from 0-999. Typically, the string is a marker for a set, i.e. 4 of 10 things, or (3/5) where the first number is the item and the second number is the total. Thanks ...

Generating data structures by parsing plain text files

I wrote a file parser for a game I'm writing to make it easy for myself to change various aspects of the game (things like the character/stage/collision data). For example, I might have a character class like this: class Character { public: int x, y; // Character's location Character* teammate; } I set up my parser to read in ...