I need a similar function in PHP for this JavaScript function
text = text.replace(/ffc/g, "Hello");
I think preg_replace will do, but i'm not sure how to write the expression..
hi,
i want to replace temp.replace
(QString("/"), QString("\"));
Here i am getting error
error C2001: newline in constant
error C2275: 'QString' : illegal use of this type as an expression
How can i replace "/" with "\"
So I want to iterate for each character in a string.
So I thought:
for (char c : "xyz")
but I get a compiler error:
StackCharTester.java:20: foreach not applicable to expression type
How can I do this?
I'd like to bind to the element name of a node in my XmlDataProvider. I can't seem to get local-name() to work within my XPath expression. Does XAML support local-name()?
<TextBlock Text="{Binding XPath=local-name()}" />
What is the warning level you use while compiling QT projects?
When I compiled with W4, I'm getting a lot of warnings such as:
C4127: conditional expression is constant
Should I compile at W3, or find other ways to handle warnings at W4, such as: adding a new header file and using pragma's(mentioned here C++ Coding Standards: 101 Rules, Guidelines, and Best Practices).
What are your practices?
Thansk.
I need to find all strings without a given string before it.
For Instance:
Find: "someValue"
**All results with "function(" before them should be ignored
The Visual Studio regular expression would find this:
value = someValue
And Ignore something looking like this:
function(someValue)
What is the best way to go about this?
Thanks for the help!
I would like to display static (shared) objects at runtime in a PropertyGrid but if I try to set the selected object property of the grid like this:
_propertyGrid.SelectedObject = System.Windows.Forms.Application
I get a compilation error:
'Application' is a type and cannot be
used as an expression.
Is there a way to display a static (shared) object or the object's properties in the PropertyGrid?
What is the simplest possible C function for starting the R interpreter, passing in a small expression (eg, 2+2), and getting out the result? I'm trying to compile with MingW on Windows.
I have sentences as shown in the below examples:
$sen1 = "The quick brown fox jump KEYWORD over123 the3 lazy dog, fox is quick";
$sen2 = "The quick brown fox jump123 KEYWORD over the lazy dog, fox is quick";
i want to use the keyword 'KEYWORD' as my search string to extract the alphanumeric words before and after the search string using Perl regular expression.
sample output:
over123
jump123
NB: The word 'the3' is left out because i'm only searching for alphanumeric words exactly before or after the 'KEYWORD'.
Thanks
On lots of sites now, you can see a Facebook "Like" Button.
- When depressed, it changes background color.
- When mouse-overed, it allows you to write some additional text
I love this interface - lightweight action, but allow for expression of more data if the user wants to.
Anyone has written a similar plugin?
One of my co-workers wrote an ActionResult that accepts a Predicate as its input parameter. We need to call this method through jQuery - but obviously that doesn't work. Is there any way to pass a query through a method in jQuery that it will accept?
public ActionResult List(Predicate<TModel> expression)
{
// ...
}
$('#item').load('/list', //... ???
)
Seriously, why can't I parse a string with angle brackets using the Javascript regular expression object?
var r = new RegExp(), r;
r.compile("\\<div\\>", "g");
r = r.exec("<div>Hello</div>"); //Equals null yo
Why does that not work?
Hello,
I am trying to create a regular expression in C# that allows only alphanumeric characters and spaces. Currently, I am trying the following:
string pattern = @"^\w+$";
Regex regex = new Regex(pattern);
if (regex.IsMatch(value) == false)
{
// Display error
}
What am I doing wrong?
Thank you!
I am writing a forum in Python. I want to strip input containing the right-to-left mark and things like that. Suggestions? Possibly a regular expression?
Hello everyone,
I am trying to assign a regular expression result to an array inside of a bash script but I am unsure whether that's possible, or if I'm doing it entirely wrong. The below is what I want to happen, however I know my syntax is incorrect:
indexes[4]=$(echo b5f1e7bfc2439c621353d1ce0629fb8b | grep -o '[a-f0-9]\{8\}')
such that:
index[1]=b5f1e7bf
index[2]=c2439c62
index[3]=1353d1ce
index[4]=0629fb8b
Any links, or advice, would be wonderful :)
I am a php beginner and seed on the forum such a php expression:
$regex = <<<'END'
/
( [\x00-\x7F] # single-byte sequences 0xxxxxxx
| [\xC0-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx
| [\xE0-\xEF][\x80-\xBF]{2} # triple-byte sequences 1110xxxx 10xxxxxx * 2
| [\xF0-\xF7][\x80-\xBF]{3} # quadruple-byte sequence 11110xxx 10xxxxxx * 3
)
| ( [\x80-\xBF] ) # invalid byte in range 10000000 - 10111111
| ( [\xC0-\xFF] ) # invalid byte in range 11000000 - 11111111
/x
END;
is this code correct? what should mean some strange (4 me) constructions like <<< 'END' / /x and END;
thanks
I'm having trouble finding a regular expression that matches the following String.
Korben;http://feeds.feedburner.com/KorbensBlog-UpgradeYourMind?format=xml;1
One problem is escaping the question mark. Java's pattern matcher doesn't seem to accept \? as a valid escape sequence but it also fails to work with the tester at myregexp.com.
Here's what I have so far:
([a-zA-Z0-9])+;http://([a-zA-Z0-9./-]+);[0-9]+
Any suggestions?
In C++0x, methods can be overloaded on whether or not the expression that denotes the object on which the method is called is an lvalue or an rvalue. If I return *this from a method called via an rvalue, do I need to explicitly move from *this or not?
Foo Foo::method() &&
{
return std::move(*this); // Is this move required or not?
}
Unfortunately, I can't simply test this on my compiler since g++ does not support this feature yet :(
How do I filter for records on a DataTable which are on a certain date?
I've tried plain [datecol] = #11 March 2010# and CONVERT([datecol],'System.DateTime') = #11 March 2010#. With no luck.
MSDN: RowFilter Expression Syntax
Solution
[datecol] >= #11 March 2010 00:00# AND [datecol] <= #11 March 2010 23:59:59#
Hi i'm trying to do a regex that will show all product keys with the value #####-#####-#####-#####-#####
this is the regular expression i have created
[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}
for some reason it just isn't working.
Any help?
I'm running this query:
SELECT FROM com.Data WHERE entryDate DATE('2010-3-16')
I get this error:
org.datanucleus.store.appengine.query.DatastoreQuery$UnsupportedDatastoreFeatureException: Problem with query DATE('2010-3-16'): Unsupported method while parsing expression: InvokeExpression{[null].DATE(Literal{2010-3-16})}
The same query works when I use it on the admin console. But it does not work for code (java), either locally or when deployed. Any ideas?
I'm trying to execute a PL/SQL function in EclipseLink which uses Oracle Specific types(eg. Boolean).
I've tried using PLSQLStoredProcedureCall which complains that I'm not executing a procedure and I have tried using StoredFunctionCall but that returns
PLS-00382: expression is of wrong type
Has anyone developed a solution to invoke functions in EclipseLink with Oracle Types? I have heard that it would be possible to extend StoredFunctionCall but I'd rather leverage existing functionality as much as possible.
Is there any common way to decompose an expression created by [NSPredicate predicateWithFormat] to objects NSComprasionPredicate, NSExpression and other?
For below example need to disassemble into components.
[NSPredicate predicateWithFormat:@"(0 != SUBQUERY(collection, $x, $x.name == "Name").@Count)"];
Is it possible to construct a PCRE-style regular expression that will only match each letter in a list only once?
For example, if you have the letters "lrsa" and you try matching a word list against:
^[lrsa]*m[lrsa]*$
you're going to match "lams" (valid), but also "lamas" (invalid for our purposes because you only had one "a"). If your letter set was "lrsaa", you would want to match "lamas".
Is this possible with regular expressions, or should I handle it programmatically?
I would like to display static (shared) objects at runtime in a PropertyGrid but if I try to set the selected object property of the grid like this:
_propertyGrid.SelectedObject = System.Windows.Forms.Application
I get this compilation error:
'Application' is a type and cannot be
used as an expression.
Is there a way to display a static (shared) object or the object's properties in the PropertyGrid?