Hi,
I'm trying to write a windows batch file that would read in a text file with certain text in it and increment some values in that file.
The text file would contain text like :
public static const COUNTER:int = 0
the batch file would then search for "COUNTER:int = 0" and increment the 0 value.
Unfortunately my knowledge of windo...
I would like to instrument Javascript code in order to "log" values of global variables. For example I would like to know all the values a particular variables foo had during execution. The logging is not the problem.
Do any of you know what would be the easiest way to implement this? I was thinking of using Rhino (the Javascript impleme...
I need to parse some C++ files, and to make things easier for me, I thought about removing multiline comments. I tried the following regex : /(\/\*.*?\*\/)/, using the multiline modifier, and it seems to work. Do you think there will be any case where it will fail?
...
I want to put these strings in a list, how do I do that? The hold up is the double "", found in the first two lines, how can I work around this?
scriptTxt = new string[]
{
"#$language = "VBScript"",
"#$interface = "1.0"",
"crt.Screen.Synchronous = True",
"Sub Main"
};
...
Hi.
A number of sites do aggregation (indeed.com, simplthired.com,expedia...) I'm trying to figure out a good/efficient way of determining that the data I get from parsing data from a page is valid. In particular, if I parse a page multiple times, (say once a day) how do I 'know' that the data i get on any given time is valid?
I'm cons...
Python Newbie.
I am looking for a way to replace the SRC attribute in all IMG tags not using Regular expressions. (would like to use any out-of-the box HTML parser included with default Python install) I need to reduce the source from what ever it may be to:
<img src="cid:imagename">
I am trying to replace all src tags to point to th...
I have a XML org.w3c.dom.Document object.
It looks sorta like this:
<A>
<B>
<C/>
<D/>
<E/>
<F/>
</B>
<G>
<H/>
<H/>
<J/>
</G>
</A>
How can I convert the Document object so that it strips off the root node and returns another Document object subset (selected by name) that looks like th...
I'm wondering if anyone has done this already.
I want to format C# source code in HTML. But with a twist! I want to turn the names of all types and methods that appear in the code into hyperlinks to the MSDN Library documentation of the types and methods.
To do a good job, the data types of variables and expressions needs to be known, ...
I have an Atom feed like this...
<?xml version="1.0"?>
<feed
xml:base="http://earthquake.usgs.gov/"
xmlns="http://www.w3.org/2005/Atom"
xmlns:georss="http://www.georss.org/georss">
<updated>2009-10-12T14:47:25Z</updated>
<title>USGS M2.5+ Earthquakes</stitle>
<subtitle>Real-time, worldwide earthquake list for the...
I'm trying to parse the XML below so that I wind up with an array that looks like the sample included... I'm having a hard time figuring out how to get the attributes inside of the tags to output the way I want it to...
The XML
<cust rid="999999" memberid="12345" lname="Doe" fname="John">
<address memberid="12345" address1="1234 M...
Hello, I am parsing an xml file from an API which I have converted into a DOMDocument in php. This is mostly fine but one problem I have is when I do this:
$feeditem->getElementsByTagName('extra');
as part of a forall statment and the element extra doesn't exist in one of the feeditems I am iterating through in the forall condition th...
Hi,
I have a task to write a (toy) parser for a (toy) grammar using OCaml and not sure how to start (and proceed with) this problem.
Here's a sample Awk grammar:
type ('nonterm, 'term) symbol = N of 'nonterm | T of 'term;;
type awksub_nonterminals = Expr | Term | Lvalue | Incrop | Binop | Num;;
let awksub_grammar =
(Expr,
funct...
Hi,
Trying to parse some XML but apparently this is too much for a lazy sunday afternoon,
this is my code: (I Tried the XPathDocument and XmlDocument approach too but this also failed miserably)
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(postData);
XDocument xDoc = XDocument.Load(new XmlNodeReader(xmlDoc));
XNamespac...
Hello I have a string in PHP
$string = "...................blah blah blah.................."
where the ......... are blank spaces (stackoverflow doesn't let me enter many blank spaces).
How do I remove this block of blank spaces before and after the "blah blah blah" text? "blah blah blah" is parsed data that changes.
Thank you.
...
Hello I would like to use preg_match in PHP to parse the "Desired text" out of the following from a html document
<p class="review"> Desired text </p>
Ordinarily I would use simple_html_dom for such things but on this occasion it cannot be used (the above element doesn't appear in every desired div tag so I'm forced to use this approa...
SAX keeps on dying on the following exception:
Invalid byte 2 of 3-byte UTF-8 sequence
The problem is its mostly correctly UTF-8 encoded but there are a few errors in it. We cannot get a new version of the file, we have to use this file.
So how do we tell SAX to ignore invalid character sequences, or clean up the UTF-8 file so that i...
Guys,
My parser evaluates PEMDAS expressions by first converting from infix to postfix then uses the standard postfix evaluation rules. I parse the expression and store the tokens in a list. This precompilation is ok for me since I plan on caching the precompiled functions.
I am trying to optimize the evaluate function (See Evaluate0...
Hi all,
I have a problem in applying a regex in my Java code.
My text string is like this (String myString)
name: Abc Def;
blah: 1 2 3;
second name: Ghi;
I need to extract the name information (Abc Def). Name can contain a string of 1+ words. All the properties (name, blah, second name) are spaced with some w...
I know there are some very good Perl XML parsers like XML::Xerces, XML::Parser::Expat, XML::Simple, XML::RapidXML, XML::LibXML, XML::Liberal, etc.
Which XML parser would you select for parsing large files and on what parameter would you decide one over another? If the one you would like to select is not in list then please suggest it.
...
<div>
<a href="http://website/forum/f80/ThreadLink-new/" id="thread_gotonew_565407"><img class="inlineimg" src="http://website/forum/images/buttons/firstnew.gif" alt="Go to first new post" border="0" /></a>
[MULTI]
<a href="http://website/forum/f80/ThreadLink/" id="thread_title_565407" style="font-weight:bold">THR...