Hi,
I got used to the xml support and recursive common table expressions of sql server 2005. I am just wondering whether any free dbs like mysql support these requirements nowadays? Thanks.
Christian
Hi.
I want to retrieve all hashtags from a tweet using a PHP function.
I know someone asked a similar question here, but there is no hint how exactly to implement this in PHP. Since I'm not very familiar with regular expressions, don't know how to write a function that returns an array of all hashtags in a tweet.
So how do I do this, using the following regular expression:
#\S*\w
1) Why are member constants available even if there are no instances of a its class?
2) Is the only reason why constant expressions need to be fully evaluated at compile time due to compiler replacing constant variable with literal value?
3) Since string is also an object, I would think the following would produce an error, but it doesn’t. Why?
class A
{
const string b = “it works”;
}
thank you
Hi folks,
I have a little program allowing users to type-in some regular expressions. afterwards i like to check if this input is a valid regex or not.
I'm wondering if there is a build-in method in Java, but could not find such jet.
Can you give me some advice?
Best regards
Phil
I am new to regular expressions. I want to use java's replaceAll() function to replace any CSS comments in a string.
Basically I want to use regex to search for anything that is surrounded by "/*" and "*/" and replace it with "".
Are there any search tools that allow you to set up a simple token/grammar parsing system that work similar to regular expressions?
What we want to do is search our ColdFusion code for queries that do not have cfqueryparams in them.
A regular expression gets a bit tough in this situation because I can't keep track of the start tags while looking for something else before getting an end tag.
It seems like a parsing system would work more accurately.
How can convert the below youtube urls
$url1 = http://www.youtube.com/watch?v=136pEZcb1Y0&feature=fvhl
$url2 = http://www.youtube.com/watch?feature=fvhl&v=136pEZcb1Y0
into
$url_embedded = http://www.youtube.com/watch/v=136pEZcb1Y0
using Regular Expressions?
Which way is preferred in expressions like this:
int? Id
{
get
{
int i;
return Int32.TryParse(Request["id"], out i) ? i : (int?)null;
}
}
is it better to cast on null or create a new Nullable<T> ?
If have this regular expression to test
(\&TRUNC)[\(]{1,}(.+)[\)]{1,}
And I have this "tester"
((((&TRUNC((1800,000 / 510)) * 510) * 920) + (2 * (510 * 700)) + ((&TRUNC((1800,000 / 510)) - 1) * 2 * 510 * 80)) / 1000000) * 85,715
My expected value is (inside the personal command "&TRUNC(command)")
(1800,000 / 510)
I got this value
1800,000 / 510)) * 510) * 920) + (2 * (510 * 700)) + ((&TRUNC((1800,000 / 510)) - 1) * 2 * 510 * 80)) / 1000000
How can I get only expected value in a separated group?
PS:. The expressions inside the command called for me as "&TRUNC(command)" is variable.
I need to verify that the provided string has only allowed characters using Oracle regular expressions (REGEXP_LIKE).
Allowed chars are: abcdefghijklmnopqrstuvwxyz0123456789_-.
Trying to execute
SELECT CASE
WHEN REGEXP_LIKE('abcdefghijklmnopqrstuvwxyz0123456789_-.'
, '^[a-z0-9_\-\.]+$')
THEN 'true'
ELSE 'false'
END tmp
FROM dual;
results in 'false'.
Any ideas on this?
I'm looking for a language that will parse mathematical expressions for me pretty easily, but also be able to call functions and reference variables as needed. Jeval looks to be what I'm looking for, but unfortunately I'm working in C#. Is there a .Net based equivalent to jeval?
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!
Hi, how can change only the last letter of any word of a string with regular expressions?
I use mb_strtolower() for change strings from upper to lower in Greek language and I have problem with final 's'.
I've got a string:
public://imageifarm/3600.jpg
How can I extract the
imageifarm/3600.jpg
Part out using android?
What I've tried so far:
URL drupalQuestionNodeImageURI = new URL("public://imageifarm/3600.jpg");
Log.d("TAG", drupalQuestionNodeImageURI.getPath());
but it throws this exception:
09-16 17:24:39.992: W/System.err(3763): java.net.MalformedURLException: Unknown protocol: public
How can I solve this?
I know I can use regular expressions but that seems to defeat the purpose of URL(URI) in this case.
I have text with file names scattered throughout. The filenames appear in the text like this:
|test.txt|
|usr01.txt|
|usr02.txt|
|foo.txt|
I want to match the filenames that don't start with usr. I came up with (?<=\|).*\.txt(?=\|) to match the filenames, but it doesn't exclude the ones starting with usr. Is this possible with regular expressions?
I want to strip away all letters in a string, which are not numeric. Preferably a solution made with Regular Expressions or something. And in C#.
How to do that?
I'm currently using regular expressions to search through RSS feeds to find if certain words and phrases are mentioned, and would then like to extract the text on either side of the match as well. For example:
String = "This is an example sentence, it is for demonstration only"
re.search("is", String)
I'd like to know where the is was found so that I can extract and output something like this:
1 match found: "This is an example sentence"
I know that it would be easy to do with splits, but I'd need to know what the index of first character of the match was in the string, which I don't know how to find
Hi everyone,
Is_numeric() as well as is_int() returns false if the value is 0. What can i do instead to verify that a specific value is numbers only in PHP?
Are we heading straight for the Regular Expressions camp, or are there some nice, handy feature for this out there already?
Thanks!
Hello,
I write simple application in C++/Qt. And i have a text and some octal number in it. My app splits this text by spaces. And i need to check octal numbers from text. How can i select octal numbers from this text with regular expressions?
Thank you.
I am performing actions on the page during WatiN tests. What is the neatest method for asserting certain elements are where they should be by evaluating the HTML source? I am scraping the source but looking for a clean way to navigate the tags pulled back.
UPDATE: Right now I am thinking about grabbing certain elements within HTML source using regular expressions and then analysing that to see if other elements exist within. Other thoughts appreciated.
I just found this code on wikipedia.
Link: http://en.wikipedia.org/wiki/Sizeof#Use
The code:
/* the following code illustrates the use of sizeof
* with variables and expressions (no parentheses needed),
* and with type names (parentheses needed)
*/
char c;
printf("%zu,%zu", sizeof c, sizeof(int));
It states that: "The z prefix should be used to print it, because the actual size can differ on each architecture."
I tried it on my compiler, but it gives the following result:
'zu,zu'
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 was looking for a tool that can convert C code expressions for the form:
a = (A) ? B : C;
into the 'default' syntax with if/else statements:
if (A)
a = B
else
a = C
Does someone know a tool that's capable to do such a transformation?
I work with GCC 4.4.2 and create a preprocessed file with -E but do not want such structures in it.
I'm rubbish at Regular Expressions, really!
What I'd like is to split a string containing a CCS property value into an array of [string,value,unit].
For example: if I supplied the .split() method with 1px it'd return ["1px",1,"px"]. If I were to supply, similarly, 10% it'd return ["10%",10,"%"].
Can this be done?
I appreciate all your help!
List<double> y = new List<double> { 0.4807, -3.7070, -4.5582, -11.2126, -0.7733, 3.7269, 2.7672, 8.3333, 4.7023 };
List<double> d1 = y.ForEach(i => i * 2);
Error: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
What is wrong?
Thanks