I know there is the perl regex that is sort of a minor de facto standard, but why hasn't anyone come up with a universal set of standard symbols, syntax and behaviors?
I want to use OpenGL in my WndProc but I'm not sure how. I also don't want GL to occupy the whole screen, just a portion of the screen. In the end I basically want to make a drawing win32 app but use OGL instead of GDI. so how can I tell GL to use my control (a panel) 's hdc for drawing?
Thanks
Hello, I have to get any text between:
Final-Recipient: RFC822; !HERE! Action
I need !HERE! from this example. There could be any string.
I tried something like:
$Pattern = '/Final-Recipient: RFC822; (.*) Action/';
But it doesn't work.
upd
Here is the string I'm trying to parse: http://dpaste.com/187638/
I want to parse this
(adv) much (thanks)
I want to eliminate the words and the bracket (adv) but not (thanks)
the condition is:
inside bracket, and word length inside bracket is 1-5 characters
I am using preg_match in PHP
Thank You
i have a string like this:
some_string="A simple demo of SMS text messaging." + Convert.ToChar(26));
what is the SIMPLEST way of me getting rid of the char 26?
please keep in mind that sometimes some_string has char 26 and sometimes it does not, and it can be in different positions too, so i need to know what is the most versatile and easiest way to get rid of char 26?
Hello!
I am creating a small yatzy game and i have run into some regex problems. I need to verify certain criteria to see if they are met. The fields one to six is very straight forward the problem comes after that. Like trying to create a regex that matches the ladder. The Straight should contain one of the following characters 1-5. It must contain one of each to pass but i can't figure out how to check for it. I was thinking /1{1}2{1}3{1}4{1}5{1}/g; but that only matches if they come in order. How can i check if they don't come in the correct order?
I want to copy a file from Site A to Site B according to external DB status on a timer job.
e.g
I have documents in Site A.
I want to move those documents to Site B when the document' status in external MSSQL DB is "approved".
I want to do it in a timer job.
Which way will be great to do so ?
I don't know how to use timer job and BDC job together.
Please advice me.
Thanks in advance.
BTW, I don't know much about SharePoint.
I have this regexp:
/(.*)(([0-9]([^a-zA-Z])*){7,}[0-9])(.*)/.
Given the following values
0654535263
065453-.-5263
065asd4535263
Expected Results
06****
06****
06****
Actual Results
0654535263
06****
065asd4535263
It does not match the last row because of the letters (I want to match from 0-3 letters) and it matches only last occurence (in the second row in example, it skips first row).
I have a "description textarea" inside a form where user may enter a description for an item.
This is validated with javascript before the form beeing submitted.
One of the validation-steps is this:
else if (!fld.value.match(desExp)){
And desExp:
var desExp = /^\s*(\w[^\w]*){3}.*$/gm;
Now my problem, this works fine on all cases except for descriptions where the description BEGINS with a special character of the swedish language (å, ä, ö).
This wont work:
åäö hello world
But this will:
hello world åäö
Any fixes?
Thanks
Hi all
There are a lot of numbers like 200 20.5 329.2...in a file. Now, I need replace every number A with A*0.8. Is there any simple method to replace original value with another based on original value?
Best Regards,
I've hit a wall. Does anybody know a good text editor that has search and replace like Notepad++ but can also do multi-line regex search and replace? Basically, I am trying to find something that can match a regex like:
search oldlog\(.*\n\s+([\r\n.]*)\);replace newlog\(\1\)
Any ideas?
Hi,
I want to extract the status from the string untill I found a timespan. My input is something like "Something in start but not with this keyword of sure. STATUS: My Status Is Here Which can be anything but timespan 23:59:01 and so on. I want to extract the string after STATUS: untill 23:59:01 is found. How can i achieve this through regex. this 23:59:01 is a timespan and it is always in this format hh:mm:ss
Hi all,
I'm having a problem with getting a Ruby string substitution going. I'm writing a preprocessor for a limited language that I'm using, that doesn't natively support arrays, so I'm hacking in my own.
I have a line:
x[0] = x[1] & x[1] = x[2]
I want to replace each instance with a reformatted version:
x__0 = x__1 & x__1 = x__2
The line may include square brackets elsewhere.
I've got a regex that will match the array use:
array_usage = /(\w+)\[(\d+)\]/
but I can't figure out the Ruby construct to replace each instance one by one. I can't use .gsub() because that will match every instance on the line, and replace every array declaration with whatever the first one was. .scan() complains that the string is being modified if you try and use scan with a .sub()! inside a block.
Any ideas would be appreciated!
Hello everyone.
I'm trying to redirect an easy to remember url to a php file but I'm having some trouble with the regex.
Here's what I have at the moment:
RewriteRule ^tcb/([a-zA-Z0-9]{1,})/([a-zA-Z0-9]{1,})/([a-zA-Z0-9]{1,}) /tcb/lerbd.php?autocarro=$1&tipo=$2&dsd=$3
It is working but only if I supply all 3 arguments. I want the last two arguments to be optional so it either works with only the first or all three. I'm hoping you can help me with this.
Thank you very much.
Can someone explain what the 'e' flag does, or link me to somewhere that does? I couldn't find anything via google.
Example:
preg_replace("/a(b?)c/e", "search_foo_term('\$1')", $str);
I need a validation regex for decimal. It should allow upto 5 digits after decimal.
Allow:
1
1.0
12.0
12.01
123.01
1,123.01
1,123.013
21,123.01234
3,21,123.01234
How Can I do regex for this?
Hi I have the following text:
SMWABCCA
ABCCAEZZRHM
NABCCAYJG
XABCCA
ABCCADK
ABCCASKIYRH
ABCCAKY
PQABCCAK
ABCCAKQ
This method takes a regex in out by the user and SHOULD print out the Strings it applies to but seems to print out something completely different:
private void matchIt(String regex) {
Pattern p = Pattern.compile(regex);
Matcher m = null;
boolean found = false;
for(int i = 0; i < data.length; i++){
m = p.matcher(data[i]);
if(m.find()){
out.println(data[i]);
found = true;
}
}
if(!found){
out.println("Pattern Not Found");
}
}
When inputting "[C]"
It outputs:
SMWABCCA
ABCCAEZZRHM
NABCCAYJG
XABCCA
ABCCADK
ABCCASKIYRH
ABCCAKY
PQABCCAK
ABCCAKQ
Any ideas why? I think I'm using m.find() improperly...
The goal: I want to convert a number from the format "10.234,56" to "10234.56"
Using this simple approach almost gets us there
/([\d\.]+),(\d\d)/ => '\1.\2'
The problem is that the first group of the match (of course) still contains the '.' character.
So questions are:
Is it possible to exclude a character from the group somehow?
How would you solve this with a single regexp
(I know this is a trivial problem when not using a single regexp)
I have a string;
text="Label"
and I need to replace it to:
text="{resourceManager.getString('trad', 'Label')}"
What would be the easiest expression to do this?
Hi,
In Python script,for every method definition in some C++ code of the form:
return_value ClassName::MethodName(args)
{MehodBody}
,I need to extract three parts: the class name, the method name and the method body for further processing. Finding and extracting the ClassName and MethodName is easy, but is there any simple way to extract the body of the method? With all possible '{' and '}' inside it? Or are regexes unsuitable for such task?
I need to delete some unicode symbols from the string '?????? ??????? ???????????? ??????????'
I know they exist here for sure. I try:
re.sub('([\u064B-\u0652\u06D4\u0670\u0674\u06D5-\u06ED]+)', '', '?????? ??????? ???????????? ??????????')
but it doesn't work. String stays the same. ant suggestion what i do wrong?