In the context of functional programming, a typical example of a side effect is "launch the missiles". I was just wondering where that expression comes from historically.
Hi,
I do the validation through configuration files.
But, RegexValidator does not work properly.
This Validator not disciplined even to unknown regular expression!!
Do you know about this problem?
Many thanks!!!
i need to remove content after using dreamweaver find & replace in multiple files (different content). how can i do that?. will regular expression solve this issue?
i need a regular expressions string to get all anchor tags in a page with a specific css class name, in c#/vb.net
this is what i got so far
"<a.*?href=""(.*?)"".*?>(.*?)</a>"
but my attempts to add "class=name" isnt working, also is it possible to find links where the class name appears either before or after the href with one expression ?
i am familiar with 3rd party html libraries, but thats an overkill for what i have in mind, so is the webbrowser control.
I'm retrieving an unformatted String from a twitter feed. I want to be able to turn a text URL (http://blah.com/qwerty/) into a link but don't know how...is there a handy regular expression for this?
I have an XML feed that looks something like this (excerpt):
<channel>
<title>Channel Name</title>
<link>Link to the channel</link>
<item>
<title>Heading 1</title>
<link>http://www.somelink.com?id=100</link>
<description><![CDATA[ Text here ]]></description>
<publishDate>Fri, 03 Apr 2009 10:00:00</publishDate>
<guid>http://www.somelink.com/read-story-100</guid>
<category domain="http://www.somelink.com/?category=4">Category 1</category>
</item>
<item>
<title>Heading 2</title>
<link>http://www.somelink.com?id=110</link>
<description><![CDATA[ Text here ]]></description>
<publishDate>Fri, 03 Apr 2009 11:00:00</publishDate>
<guid>http://www.somelink.com/read-story-110</guid>
<category domain="http://www.somelink.com/?category=4">Category 1</category>
</item>
<channel>
That's the rough of it. I'm using this piece of PHP (excerpt):
$xml = simple_xml_load_file($xmlFile);
$xml->xpath($pattern);
Now I want to get all ITEM-nodes (with their children) based on that pesky "domain" attribute in the category node, but no matter what I try it does-not-work.
The closest I got was "//category[@domain= 'http://www.somelink.com/?category=4']"
The expression I tried gave me this result:
[0] => SimpleXMLElement Object
(
[@attributes] => Array
(
[domain] => http://www.somelink.com/?category=4
)
[0] => Category 1
[1] => SimpleXMLElement Object
(
[@attributes] => Array
(
[domain] => http://www.somelink.com/?category=4
)
[0] => Category 1
The expression should contain all childrens of the two items in the example, but as you can see only the info in the category node is present, I want all the item nodes.
Any help would be highly appreciated.
Is there a specific way to check for a specific integer within a switch statment.
For example.
$user = $ads[$i]->from_user;
To check for the number 2 as $i in the above expression.
I have created a dataset with fields "LastRunBuild" and "project" .The LastRunBuild field contain string of data seperated by commas according to each project. But Some Projects have no value in LastRunBuild field.When i am using this expression
" iif(Fields!LastRunBuild.Value=nothing,
nothing,Split(Fields!LastRunBuild.Value,",").GetValue(3)) "
a #Error value returns every time. Please reply...
I've got a document containing empty lines (\n\n). They can be removed with sed:
echo $'a\n\nb'|sed -e '/^$/d'
But how do I do that with an ordinary regular expression in perl? Anything like the following just shows no result at all.
echo $'a\n\nb'|perl -p -e 's/\n\n/\n/s'
I'm writing a program which needs to traverse a set of directories. Tried to use the following code:
file.eachDirMatch(/.*[^.svn]/){
//some code here
}
But that ended up match none of my directories. I realize this boils down figuring out the right regex hang head in shame but even after revisiting some Java Regular Expression documentation I thought this should work.
Can you explain this?
I want to eval values and calculations from two different sources. One source gives me the following info(programmatically):
'a = 2'
The second source gives me this expression to evaluate:
'a + 3'
This works:
a = 2
eval 'a + 3'
This also works:
eval 'a = 2; a + 3'
But what I really need is this, and it doesn't work:
eval 'a = 2'
eval 'a + 3'
I would like to understand the difference, and how can I make the last option work.
Thanks for your help.
Hi all!
I can use getFunctionNameExpression() to get the function name as a expression. But i don't know how to get the name string from it. Any help ? thank you very much.
I am parsing table information from the html table.Now I want to check whether there is date in the records for one particular column.Means I want to check whether there is date in the string or not .And date can be in different format like the string can be
FUTIDX 26FEB2009 NIFTY 0 -- There is date in the string.
FUTIDX MINIFTY 30 Jul 2009 -- There is date in the string.
FUTSTK ONGC 27 Mar 2008 -- There is date in the string.
What should be the regular expression for that ?
I'm trying to write a regular expression that finds C#-style unescaped strings, such as
string x = @"hello
world";
The problem I'm having is how to write a rule that handles double quotes within the string correctly, like in this example
string x = @"before quote ""junk"" after quote";
This should be an easy one, right?
Hello, is there a good regex expression that would be able to compare two dates
like 3/27/2010 to 3/8/2010 to tell if the first date is greater then the second date?
I'd like to compare using javascript
I want to turn something like this
CS 240, CS 246, ECE 222, ... (more or less); Software Engineering students only
into
('CS 240', 'CS 246', 'ECE 222', 'ECE 220')
in Python, code that matches a single course looks like
>>> re.search('([A-Z]{2,5} \d{3})', 'SE 112').groups()
('SE 112',)
I prefer a regular expression only method because I have a bunch of other alternate reg exps using '|' to combine them. However, a method with split is acceptable.
I have a dictionary:
D = { "foo" : "bar", "baz" : "bip" }
and I want to create new dictionary that has a copy of one of it's elements k. So if k = "baz":
R = { "baz" : "bip" }
what I'v got now is:
R = { k : D[k] }
But in my case k is a complex expression and I've got a whole stack of these. Caching k in a temporary looks about as ugly as the original option.
What I'm looking for is a better (cleaner) way to do this.
I'm able to retrieve the URL of a publisher only if their URL is in the title or the description using regular expression in linkshare's coupon API but in doing so, that leaves me with a lot of publishers not having a reference to their website which I need for the type of site that I am building.
I was wondering if anyone else knows a way to reference the publishers URL preferably by their publisher ID or some other way?
I am trying to check if a html document includes script tags that are not empty using regular expressions. The regular expression should match any script tag with a content other than whitespaces or linebreaks.
I have tried
<script\b[^>]*>[^.+$]</script>
but this regex only finds script tags with one space.
I'm trying to use python to copy a tree of files/directories.
is it possible to use copytree to copy everything that ends in foo?
There is an ignore_patterns patterns function, can I give it a negated regular expression? Are they supported in python?
eg.
copytree(src, dest, False, ignore_pattern('!*.foo'))
Where ! means NOT anything that ends in foo.
thanks.
I'm trying to get this expression to work, I'm pretty sure its not the parenthesis because I counted all of them. Perhaps there something I'm doing wrong involving the parameter pow (x,y).
double calculatePeriodicPayment()
{
periodicPaymentcalc = (loan * ((interestRate / yearlyPayment))) / (1-((pow ((1+(interestRate / yearlyPayment)))),(-(yearlyPayment * numOfYearLoan))));
return periodicPaymentcalc;
}
The page can be viewed at
http://cistrome.org/cps/seqconfig?did=2693
When load in Firebugs, it gives me this error:
TypeError: $(".open_gene").on is not a function
[Break On This Error]
$(".open_gene").on('change', function(event) {
However, if I type in this expression in Firebug's console, it can be evaluated as a function without any problems:
>>> $(".open_gene").on
function()
I was wondering what might be the reason to cause this issue.
Does anyone have ideas about this? Thanks!
Given the following text:
This is!!xa simple string!xpattern
I would like to get a regexp that matches the !x that's between "string" and "pattern" but not !!xa that's between "is" and "a".
This regexp is to be used inside a string split().
I have tried several combinations but I cannot get a regexp that meets my needs. Perhaps my expression is not so regular after all =)
Thanks in advance!
I simply want to include a row number against the returned results of my query.
I found the following post that describes what I am trying to achieve but gives me an exception
http://vaultofthoughts.net/LINQRowNumberColumn.aspx
"An expression tree may not contain an assignment operator"
In MS SQL I would just use the ROWNUMBER() function, I'm simply looking for the equivalent in LINQ.