Hi
I have problem need to solved with Regex
If i am using Firefox or IE8 javascript will generate this code which is what I really want.
<div style="visibility: hidden;" id="wizardId1">1001</div><div style="visibility: hidden;" id="wizardId2">1002</div>
However with IE7 it will generate diferently to be
<DIV id=wizardId1 style="VI...
The possible values are...
1 (it will always start with a number)
1,2
4,6,10
...
Hi!
I want to extract data from such regex:
<td>[a-zA-Z]+</td><td>[\d]+.[\d]+</td><td>[\d]+</td><td>[\d]+.[\d]+</td>
I've found related question http://stackoverflow.com/questions/1327369/python-extract-contents-of-regex
but in my case I shoud iterate somehow.
...
<script language="javascript">
alert("......");
var regExpression = /^([a-zA-Z0-9_\-\.]+)$/; //line 2
//// var regExpression = "/" + "^([a-zA-Z0-9_\-\.]+)$" + "/"; //line 3
alert (regExpression.test("11aa"));
alert("......2");
</script>
The above code is working fine.
But if we replace line 2 by line 3 then it is not working
why?
i...
In a repository for a well known open source project, all files contain a version string with a timestamp as their first line:
<?php // $Id: index.php,v 1.201.2.10 2009-04-25 21:18:24 stronk7 Exp $
Even if I don't really understand why they do this - since the files are already under version control -, I have to live with this.
The ...
I have an xml file which describes (among other things) elements with attribute values that describe fully qualified java class names. I am trying to write an XSLT transformation to modify the class names described in this file, such that (for example) ocurrances of com.example.MyClass will become com.example.MockMyClass.
Here's that ex...
What is the regular expression for . and .. ?
if(key.matches(".")) {
do something
}
The matches accepts String which asks for regular expression. Now i need to remove all DOT's inside my MAP.
...
Hi guys i am trying to figure out a simple regEx from the given text below:
<b>Name:</b> Photomatix.Pro.v4.0.64bit-FOSI<br />
i basically want to output and store only Photomatix.Pro.v4.0.64bit-FOSI i.e. the actual value thats inside the but when i define it like this:
private static final String REG_NAME = "<b>Name:</b>(.*)<br />"...
I am wondering why the results of the java regex pattern.matcher() and pattern.matches() differ when provided the same regular expression and same string
String str = "hello+";
Pattern pattern = Pattern.compile("\\+");
Matcher matcher = pattern.matcher(str);
while (matcher.find()) {
System.out.println("I found the text " + match...
There is no problem to get the src or alt separately,but how can get both at the same time every one with a group name.
We have to bear in mind that alt can be to the left or right of src.
I am in a hurry, so I found a quick solution, creating 3 groupnames for the src, and and for alt. I know we can do it a lot better.
private voi...
I'm looking in our code for something that looks very much like:
#$foo="bar";
$foo="baz";
Problems:
I don't know the name of the variable
I don't know which line is actually commented out.
I really don't seem to be able to properly write a multi-line regex.
My initial attempt was ack /\$(.\*)=.\*$\$($1)=/
I prefer ack usually for...
I have a lot of option tags. I would like to remove the tags and get only the values.
This is the code:
<?php
$result = preg_replace('/<option value=\"\d+\" >([A-Za-z0-9]+)<\/option>/', '$1', $result);
?>
I cannot use strip_tags, strip_tags output:
id="pesq_marca" class="select164" size="1" onchange="exibeModelosSelectpesq_marca(thi...
I notice that vim's substitute regex is a bit diffrent with other regexp, what's the diffrent with them.
...
http://stackoverflow.com/questions/3861970/regexpression-test
I have posted a problem in the above link
based on that i have done like bellow
That too is error
var regExpression=new RegExp("^([a-zA-Z0-9_\-\.]+)$");
alert (regExpression.test("11aa"));
...
Hey guys!
I need help with something that should be relatively simple.
Got the component installed in my project fine and added all of the necessary config entries.
I need to rewrite URLs following two rules (for canonilization/SEO
purposes):
1 - all URLs that don't have "www" need to be rewritten to include
it.
Example: user ty...
Part of my .htaccess file looks like this-
AuthUserFile /path/to/.htpasswd
AuthName "Authorization Required"
AuthType Basic
require valid-user
Doing that requires the Basic HTTP authentication for the entire directory and the directories below it as well. However, I have a single file within that root directory, thubservice.php, that...
Is it possible to create rules in Outlook 2007 based on a regex string?
I'm trying to add a filter for messages containing a string such as: 4000-10, a four digit number followed by a dash and then a two digit number, which can be anything from 0000-00 to 9999-99.
I was using this as a regex: \b[0-9]{4}\-[0-9]{2}\b but the filter isn...
Can I have a translation of PHP’s preg_match_all('/(https?:\/\/\S+)/', $text, $links) in Python, please? (ie) I need to get the links present in the plain text argument in an array.
...
I'm trying to export matches from preg_match_all to a csv file but am getting the following error:
Warning: fputcsv() expects parameter 2 to be array, string given
This is the section of code I'm having issues with, how can I modify it so I am able to export the matches to a csv file?
preg_match_all($pattern, $pos, $matches);
$fp = ...
I need to remove all characters from the given string except for several which should left. How to do that with regexp?
Simple test: characters[1, a, *] shouldn't be removed, all other should from string "asdf123**".
...