What's the best regular expression for integer separated by comma? It can also contain space between comma, and the field is not required which means it could be blank.
123,98549
43446
etc..
I'm not that good with regular expressions...
I need a JavaScript regular expression that will do the following:
The string can contain letters (upper and lower case), but not punctuations such as éàïç...
The string can contain numbers (0..9) anywhere in the string, except on the first position.
The string can contain underscores (_).
Valid strings:
foo
foo1
foo_bar
fooBar
Invalid strings:
1foo -- number as first character
foo bar -- space
föo -- punctuation ö
Many thanks!
I just had to write the most redonkulous expression in an SSIS Derived Column to get dates formatted like "01-JAN-2010". It lookes like this:
There's got to be a better way... isn't there?
Why I can't construct large tuples in Haskell? Why there's a tuple size limit?
Prelude> (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)
<interactive>:1:0:
No instance for (Show
(t,
t1,
t2,
...
t23))
arising from a use of `print' at <interactive>:1:0-48
Possible fix:
add an instance declaration for
(Show
(t,
t1,
t2,
...
t23))
In a stmt of a 'do' expression: print it
I am wondering what this technique is called and what it does. It seems to be validating some regular expression on the variable url. I am customizing another persons code:
var url = document.getElementById("editorURL").value;
if(/(file|http).*/.test(url)) {
}
Maybe someone has a link to an article that explains this a bit more in-depth?
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?
validates_format_of :email,
:with => /^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" + @"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" + @".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)/,
:message => "is missing or invalid"
Please let me know where is the problem? Is regular expression is wrong?
Sorry for this english related question but I only came across that expression in the context of IT. What does abstracting over something mean ? For example abstracting over objects or abstracting over classes.
Thanks
Class<? extends Algorithm> alg = AlgorithmAllFrom9AndLastFrom10Impl.class
Constructor<Algorithm> c = alg.getConstructors()[0];
For "alg.getConstructors()[0];" I am getting a warning in eclipse
Type safety: The expression of type
Constructor needs unchecked conversion
to conform to Constructor
How do I fix this?
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'
Hi all
Say I got 3 entities: Business, Employee and Payment. A payment has a foreign key to an Employee, while the Employee has an foreign key to a business.
Now, I want to create a query which gives me all payments for a given business. I really don't have a clue about how to do this - I guess I want something like:
mySession.CreateCriteria<Payment>()
.Add(Criterion.Expression.Eq(/* Employee_FK => Employee.Business_FK == BusinessID */);
Any help would be greatly appreciated :)
hi,
my window.location is "F:/html5/home.html", from my location i need to get the file name like this "home.html", to do this, how to i use the regular expression command?
any one help me?
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...
Hi,
with $("#TextInputElement").select()
I am able to select a text (mark it) in an in an input text field.
Now I only want to select the text in between brackets in that input field.
I have the regular expression match(/-[^-]*-/) to select, but how would I apply this to only select the text inside the input field between brackets?
[noselect]textToBeSelected[/noselect]
thx
Hello everybody
I have a user entity who contains a one to many relationship with a role entity
So with this linq expression :
from user in USER_TABLE.Include("USERROLE_TABLE")
order by user.Name
select user
I can get users with related roles as a child.
My problem is that i want to get roles of each user ordered alphabetically.
How can i do that ? I googled a lot and don't find anything
Thank's by advance !
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 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.
Hello
I want a regular expression which will ignore the sentence containing "XYZ" character.
I am using this but this is not working
"(.+[^XYZ])"
Thanks in advance
Hi,
I want to translate LINQ expression tree to SQL statement and I don't want to write my own code for this.
Example:
var query = from c in Customers
where c.Country == "UK" &&
c.City == "London"
select c);
To
SELECT ... FROM Customers AS c WHERE c.Country = "UK" AND c.City = "London"
I know DataContext.Log, but I want to use:
query.ToSqlStatementString()
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'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?
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.
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.