There is a form field where users should input domain names in the form of "google.com".
However, taking into consideration confused users, I want to be able to clean the input to the exact form of "google.com" in case they type in the following cases:
http://www.google.com
http://google.com
google.com/blah
www.google.com
..and other i...
Hi
As the title says, what is the Java equivalent of JavaScript's String.match()
I need to get an array or a list of all matches
Example:
var str = 'The quick brown fox jumps over the lazy dog';
console.log(str.match(/e/gim));
gives
["e", "e", "e"]
http://www.w3schools.com/jsref/jsref%5Fmatch.asp
regards
Jon
...
How do I parse string "7c23a12f0cffa6cf2fac0baf8eacf4c1" from a file .. I am trying to retrieve the data between _id= and &
example file:
4593733f4ab534f0001ecbe20000b3e9/cgi-bin/rsspipes/dispatch?Alternative=10...
need a simply preg_match, which will find "c.aspx" (without quotes) in the content if it finds, it will return the whole url. As a example
$content = '<div>[4]<a href="/m/c.aspx?mt=01_9310ba801f1255e02e411d8a7ed53ef95235165ee4fb0226f9644d439c11039f%7c8acc31aea5ad3998&n=783622212">New message</a><br/>';
now it should preg_match "c....
I'm looking for a PHP preg_replace() solution find links to images and replace them with respective image tags.
Find:
<a href="http://www.domain.tld/any/valid/path/to/imagefile.ext">This will be ignored.</a>
Replace with:
<img src="http://www.domain.tld/any/valid/path/to/imagefile.ext" alt="imagefile" />
Where the protocol MUST...
I am new to regular expressions and have just started learning some. I was wondering what are some of the most commonly used regular expressions by the programmers. Put it in another way, I would like to know what are the regular expressions most useful for? How can they help me in my every day tasks? I would prefer to know regular expre...
E.g. Input string str = "1111222233334444";
return value ArrayList A where A[0] = "1111", A[1] = "2222", etc.
Use of Linq or reg ex would be good.
...
Hello there,
Given the following string how can I match the entire number at the end of it?
$string = "Conacu P PPL Europe/Bucharest 680979";
I have to tell that the lenght of the string is not constant.
My language of choice is PHP.
Thanks.
...
Need some help, I have a regular expression that appears to work just fine when I put the pattern and string to parse into regexlib's tester. However, when I put it into C#, the same does not happen, no match.
Here is my match pattern, have tried both:
string regPattern = "\\{\\$([^\\$\\}]+)\\$\\}";
My string to parse comes from a d...
My site currently handles URL's like this...
/?p=home
/?p=profile&userid=1
/?p=users.online
/?p=users.online&page=23
/?p=mail.inbox
/?p=mail.inbox&page=12
... and so on, there is probably at least 120-150 different pages, on my site a page is built like this,
index.php includes a main config file which then includes func...
Hi
I'm trying to match a certain set of tags in a template file. I however want the tags to be
able to be nested in itself.
My regex is the following: (with /s)
<!-- START (.*?) -->(.*?)<!-- END \\1 -->
Tag example:
<!-- START yList -->
y:{yList:NUM} |
<!-- START xList -->
x:{xList:NUM}
<!-- END xList -->
<!-- CARET x...
I am wanting to use mod-rewrite for cleaner URL's across my whole site which is going to be really hard, I will have to most likey rename many files/structure.
Would this be possible though if a page currently is like this
www.domain.com/?p=users.online&page=23
to re-write it as
/users/online/page/23
but then also work wh...
<? $mysite = ('websiteurl');?>
<? echo $mysite; ?> Links not found
<?
$time_limit = 3600;
set_time_limit($time_limit);
include_once("myconnect.php");
$sql0="select * from trade where 1 ";
$sql0=$sql0." order by a1 asc";
$query=mysql_query($sql0);
$cnt=1;
while ( ($rs_query=mysql_fetch_array($query)) )
{
if($cnt%2<...
I finally figured out a good/easy way to make clean URLs with regex on my site in this format below, however it will require a very large .htaccess file, I know from the post on here that it is supposed to not be to bad on performance to use mod_rewrite but I have never really seen it used where the way I am, with a seperate entry for al...
"something here ; and there, oh,that's all!"
I want to split it by ; and ,
so after processing should get:
something here
and there
oh
that's all!
...
Hi Guys,
I need to change
1 A
2 B
3 C
4 D
to
A
B
C
D
which means the decimal letter at the begining of every line and the following one or more blank should be deleted .
I'm only familiar with Reqex in Perl, so I try to use :%s/^\d\s+// to solve my problem, but it does not work. so does anyone of you can tell me how to get ...
Hi guys,
I've tried several regex combinations to figure out this, but some or the condition fails,
I have an input string, that could only contain a given set of defined characters
lets say A , B or C in it.
how do I match for something like this?
ABBBCCC -- isMatch True
AAASDFDCCC -- isMatch false
ps. I'm using C#
...
So, i have some String with digits and another symbols, and i want to increment the value of each digit at 1. For example: "test1check2" from this String i want to recieve "test2check3". And can i make this only with method "replaceAll"? (i.replaceAll("\d", ...) something like that)?, without to use methods such like indexOf, charAt......
Is there a reason why the following piece of code doesn't work in IE?
While with FF and other sane browsers it splits the string by the given expression, in IE it simply doesn't work.
var str = "abc<font id=\"something\">def</font>gh";
alert(str.split(/(\<.*?\>|.)/).length);
Thank you.
...
Hi Guys
I need to add a trailing / to a url if it doesn't have one or isn't a file
so
http://www.ddd.com/dasdas
becomes
http://www.ddd.com/dasdas/
But I don't what to just add slash the URl as this will end up with filename like this style.css/
So I need a piece of Regex that I can put into the IIS 7 rewrite engeine to append when...