Members neighborhoods a regular expression!!!

Category: Web Develop
 
yangqunwuyang
2011-10-10 09:14:48

Sponsored Links
The paragraph beginning with & in all, not a ";" at the end replace?
Such as: alowrw & & a DDC then how will & a replace!

Thank you!

Sponsored Links

senlin7906
2011-10-10 09:17:41
Do not use regular expressions you, Oh, the regular expression matches the longest default satisfy the conditions, such as the following case with
& \ \ w *; replace it will be the wrong replacement
tom & jerry is my favorite cartoon;
a regular expression, then it will be only for the tom, and this is not say can not do, but also need some such as length
like other qualifications go, but in the end can not guarantee foolproof
annyzhao2006
2011-10-10 09:29:21
That is, matching all appeared & , if not in order; ending
onlylovexmy
2011-10-10 09:48:03
certainly want to consider these out!! Please then give recommendations
happysky1840
2011-10-10 09:56:05
then of course you must first description & abcde is asked to replace & a still & ab ...
if you just want to replace &aaa; & abcde &aaa; words, it is the replacement & ... & to & ; touches can achieve
Java RegExp

patternString = "\ \ & + [^ \ \ &] * \ \ & +"
resultString = yourString.replaceAll (patternString, "&");

JavaScript RegExp

yourString.replace (/ \ & + [^ \ &] * \ & + / g, '&');
zhoubopost
2011-10-10 09:58:20
it and then ask one of the <> should appear in pairs, if not in pairs, then the <or> Replace

as: aaaaaaaa <a ssssssss <b ...> </b> ccccc, that <a's <replaced. ask!!
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.