I have the following html with multiple inputs:
<input type="submit" value="Save and close" name="commit"/>
<input type="submit" value="Save" name="commit"/>
and would like to use cucumber to test clicking on the "Save" button. However, when I do this in a cucumber test:
When I press "Save"
it clicks on the "Save and close" button,...
Hello,
I'm not sure if there is away to do this but it doesnt hurt to ask i'm using regexkitlite to create a iPhone app. Im specifically using the Regex lib to parse some html. My question is in a regular expression such as @"<a href=([^>]*)>([^>]*) - " each match in between the brackets can be placed in an array using
NSString *r...
how do I get the regex mentioned in this article working with preg_match in php?
<?php
preg_match("\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))/i", $text, $matches);
print_r($matches);
?>
Using the code above I get the following error:
Warning: preg_match() [function.preg-match]: Delimiter must not be alphanume...
I've been looking at the re documentation and at other questions but I keep running into trouble with regex.
I need to take what ever is in the [tag] off of the string.
string = "Article Name [Tag Name]"
#and I want to go to
string = "Article Name"
I'd really appreciate it if anyone could help.
...
I have a set of urls :
/products
/categories
/customers
Now say a customers is named john, and I want to help john to reach his own account page with a shorter url:
before : /customers/john
after : /john
(suppose customer names are unique)
I'm trying to figure out a proper regex dispatcher so all customers can have ...
I've taken the Liberal URL Regex from Daring Fireball, merged it with some of Alan Storm improvements and hacked my way into fixing some bugs like support for IDN chars inside parentheses. This is what I've:
/(?:[\w-]+:\/\/?|www[.])[^\s()<>]+(?:(?:\([^\s()<>]*\)[^\s()<>]*)+|[^[:punct:]\s]|\/)/
However I've encountered a bug that I'm n...
hi,
I need a regular expression which accepts the alphabets UPPER CASE,lower case and digits
minimum character is 5 and maximum character is 20.
This is my current Reg Ex.
^[A-Za-z\d]{5,20}$
The issue that i am facing with the current Regular expression is,
if i enter 5 spaces it accepts. so i want the user to enter password withou...
I want to find the second <BR> tag and to start the search from there. How can i do it using regular expressions?
<BR>like <BR>Abdurrahman<BR><SMALL>Fathers Name</SMALL>
...
In Perl, what regex should I use to find if a string of characters has letters or not?
Example of a string used: Thu Jan 1 05:30:00 1970
Would this be fine?
if ($l =~ /[a-zA-Z]/)
{
print "string ";
}
else
{
print "number ";
}
...
I have database where one column contains numbers. 3 example values:
1111111555
2222222555
3333333555
which I need to reverse and put a dot between each digit. i.e. the result for each of the examples above would be:
5.5.5.1.1.1.1.1.1.1
5.5.5.2.2.2.2.2.2.2
5.5.5.3.3.3.3.3.3.3
respectively.
I then need to update another column wi...
Hi,
I need to try a string against multiple (exclusive - meaning a string that matches one of them can't match any of the other) regexes, and execute a different piece of code depending on which one it matches. What I have currently is:
m = firstre.match(str)
if m:
# Do something
m = secondre.match(str)
if m:
# Do something el...
This is the code I use,
<IfModule mod_rewrite.c>
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([^/]+)/?([^/]+) index.php?user=$1&do=$2 [L]
</IfModule>
if i give it abcd/1234 it will capture abcd first then 1234 as the second variable. But if the url was abcd/ or abcd the first capture stays th...
How can I check if a string contains at any position one or more '/' character(s) in Regex?
Thanks.
...
Hi, I've this ISAPI_Rewrite rule:
RewriteRule /([^/.?]+) /sc.asp?p=$1 [I,L]
This rule should rewrite Urls like:
/some-article
/article2
and shouldn't rewrite Urls like:
/home.asp
/admin (because there's a directory named admin)
/admin/
/sites/gutterman
It works great in ISAPI_Rewrite
Yesterday I bought ...
From the following markup.
<div id="my-div">
<a href="#" id="link-1">Somewhere</a>
<a href="#" id="link-2">Somewhere else</a>
</div>
What are some options, using jQuery selectors and JavaScript for grabbing the integer in the ids?
For example.
$("#my-div a").click(function(){
$(this).id // ... somehow grab n from "link-...
I can't seem to find a Regular Expression for javascript that will test for the following cases:
c:\temp
D:\directoryname\testing\
\john-desktop\tempdir\
You can see what I'm going for. I just need it to validate a file path. But it seems like all the expressions I've found, don't work for javascript.
Thank you in advance.
John
...
Hi,
I am not too good with regular expressions so this might be an obvious question.
I want my expression to match if a certain number of characters are found and fail if any extra characters are present. For example if I have a string that should have 4 digits the following should be true.
1234 - match
ab1234cd - does not match
0123...
This may be a dumb question, but I couldn't find it anywhere:
How can I use the java OR regular expression operator (|) without parentheses?
e.g:
Tel|Phone|Fax
...
The setup:
I have a standard .php file (index.php) that contains two includes, one for header (header.php) and one for footer (footer.php). The index.php file looks like this:
index.php
<?php
include header.php;
?>
<h2>Hello</h2>
<p class="editable">Lorem ipsum dolar doo dah day</p>
<?php
include footer.php;
?>
header.php like thi...
I'm trying to retrieve link text from an HTML file. Each of the link have a specific class applied to them, but the urls are different.
I have the following:
...
<a class="fetch-me" href="products/1">Find ME!!!</a>
...
<a class="fetch-me" href="products/2">Me too!</a>
...
I am using the following PHP code, but always getting more th...