Is it possible to use a regular expression to get filenames for files matching a given pattern in a directory without having to manually loop through all the files.
I have street name as KRZYWON ANIELI and so what should be my regex to allow this kind of expression. Currently I have simple one which uses /^[a-zA-Z ]+$/
Kindly advise.
I am porting some C++ code to GCC, and apperantly it isn't happy with C++ style casting when sapces are involved, as in unsigned int(-1), long long(ShortVar) etc... It gives an error: expected primary-expression before 'long'.
Is there any way to make peace with GCC without going over each one of those and rewrite in c-style?
The first definition below produces the warning in the title when compiled with f# 3.0 and the warning level set to 5. The second definition compiles cleanly. I wondered if someone could please explain just what the compiler worries I might accidentally mutate, or how would splitting the expression with a let clause help avoid that. Many thanks.
let ticks_with_warning () : int64 =
System.DateTime.Now.Ticks
let ticks_clean () : int64 =
let t = System.DateTime.Now
t.Ticks
Im trying to compare these two chars but on win 32 Visual Studio 2008:
if(mychar1 == 'ä' || mychar2 == 'Ä')
Erromess:
Debug Assertion Failed!
File:f\dd\vctools\crt_bld\self_x86\crt\src\xstring
Line 1575
Expression: string subscript out of range
Hello,
I have a document that I'm parsing text out of - I'm trying to figure out how to use this RegEx expression to take out everything that isn't alphanumeric, but I want to keep quotes, ampersands and colons/semi-colons.
s = Regex.Replace(s, @"[^\w-]+", " ");
How can I add a replace all of these "except these" pattern here?
Thank you!
I need an expression to capture a string like this
"A"[A string that is NOT atleast 5 and atmost 6 digits]"B", In other words capture anything that is NOT the following
A[0-9][0-9][0-9][0-9][0-9]B
A[0-9][0-9][0-9][0-9][0-9][0-9]B
I have tried the negative look ahead
regex = "a((?![0-9]{5,6}).)*d" ;
But it fails to capture all scenarios.
Please help
venu
For what x is
The expression x IS NOT NULL is not equal to NOT(x IS NULL), as is the case in 2VL
(quote from this answer, which is quoting Fabian Pascal Practical Issues in Database Management - A Reference for the Thinking Practitioner -- near the end of that answer)
My guess is when x IS NULL is NULL, but I cannot guess when that would be (i.e. I haven't checked the SQL standard).
I added following line of code in .vimrc
let g:jslint_status = 'enabled'
if exists("jslint_status")
echo jstlint_status
else
echo 'not found'
endif
Error message
E121: Undefined variable: jstlint_status
E15: Invalid expression: jstlint_status
What am I doing wrong?
I have an InfoPath 2007 browser-enabled form that has a datasource with three columns, let's say columns A, B, and C. I have a dropdown that is keyed to column A and displays column B. Column C contains some data that I want to display in an expression box, and that I also want to use in some data validation against another field on the form. I'm looking for some help on how to reference that column C for displaying and use in validation. Thanks!
I am new to PHP and regular expression. I was going thorugh some online examples and came with this example:
<?php
echo preg_replace_callback('~-([a-z])~', function ($match) {
return strtoupper($match[1]);
}, 'hello-world');
// outputs helloWorld
?>
in php.net but to my surprise it does not work and keep getting error:
PHP Parse error: parse error, unexpected T_FUNCTION
Why get error ?
How do I restrict a string to whitelisted characters?
// "HOW am I to understand; this is, BAD"
$str = restrictTo($str,"0-9a-z,. ");
// " am I to understand this is, "
Is there an inbuilt function in PHP that does something close? I can't formulate a regular expression for this though :(
I am trying to sort the following table:
hYear hSale
------------------------------------
[year] =Count(Fields!sale.Value)
The table only has one row group (year) and no column group.
I'd like to:
-initially sort the table based on the calculated value; is it possible?
-add interactive sort to calculated column based on the value. I assume I should sort 'Detail rows', but what will be the sort expression?
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 believe the expression T() creates an rvalue (by the Standard)
However the following code compiles (at least on gcc4.0)
class T {... };
int main()
{
T() = T();
}
I know technically this is possible because member functions can be invoked on temporaries and the above is just invoking the operator= on the r-value temporary created from T().
But conceptually this is like assigning a new value to an r-value.
Is there a good reason why this is allowed?
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
static void Main()
{
string[] a = { "a", "asd", "bdfsd", "we" };
a = a.OrderBy(fun).ToArray();
}
private static int fun(string s)
{
return s.Length;
}
its is giving compile time error . I know that we can do this with Lambda expression like this. a.OrderBy(s=>s.Length).ToArray(); but i want to this do by defining different function . What mistake i have done?
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
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
hey,
I have two-dimension array
List<List<int>> boardArray
How can I enumerate throw this array to check that it contains other value than 0 ?
I think about boardArray.Contains and ForEach ,cause it return bool value but I don't have too much experience with lambda expression :/
Please help :)
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 need to know if the List I am working with contains only some specific values.
var list = new List<string> { "First", "Second", "Third" };
If I want to know if the List contain at least one item with the value "First" I use the Any keyword:
var result = list.Any(l => l == "First");
But how I can write a Linq expression that will return true/false only if the List contains "First" and "Second" values?
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 !
Hi, all.
I'm trying to convert an all-uppercase string in Ruby into a lower case one, but with each word's first character being upper case. Example:
convert "MY STRING HERE" to "My String Here".
I know I can use the .downcase method, but that would make everything lower case ("my string here"). I'm scanning all lines in a file and doing this change, so is there a regular expression I can use through ruby to achieve this?
Thanks!