Ask a Question related to ASP.NET General, Design and Development.
-
powerranger #1
Regex help
I'd like to replace any html tags containing "< >" with a space. For
example, <TR VALIGN=TOP>, I'd like to replace that with a space. Is
there a way to do this? Thanks.
powerranger Guest
-
REGEX help pls
in the regex buddy they are explaining: "Be careful when using the negated shorthands inside square brackets. is not the same as . The latter... -
Regex..
Could some good samaritan help me out with this pls... I am trying to find a regular expression for the below string.. ExchangeName =... -
regex, is this possible?
Hi! I am trying to break down the following: printf("numsteps=%d i=%d im=%g vfr=%g \n",numsteps,i,imeas,vforce); into "numsteps= numsteps ... -
Need help with regex
> I have a directory of files that I want to move to another directory. -
IP regex?
Gareth Glaccum wrote: How about using m/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/ and testing $1 - $4 for compliance? Much cleaner. -- Cheers, -
Ross Donald #2
Re: Regex help
Hi,
The expression would be something like this:
\<(.+?)\>
Group 1 will be the contents of the html tag without the brackets.
e.g.
// C#
string _InputText = "example, <TR VALIGN=TOP>, I'd like to replace";
Regex MyRegex = new Regex(@"\<(.+?)\>", RegexOptions.IgnoreCase);
string nohtmltags = MyRegex.Replace(_InputText, " ");
Another one would be
\<([^>]+)\>
explanation:
Match '<'
Match one or more characters but dont match '>'
Match '>'
--
Ross Donald
RAD Software
[url]http://www.radsoftware.com.au[/url]
"powerranger" <tangolp@yahoo.com> wrote in message
news:13bc95e0.0306241441.5e701435@posting.google.c om...> I'd like to replace any html tags containing "< >" with a space. For
> example, <TR VALIGN=TOP>, I'd like to replace that with a space. Is
> there a way to do this? Thanks.
Ross Donald Guest
-
mdew #3
regex help
This isnt specifically a perl question, I'm running squid, and running it
through a regex. The question, I'm trying to filter out some spam/ad sites
using regex, I started with the "Penis Enlarging" websites.
I want to match "penis" and "enlarge" in any order, So far I've got
[(penis)(large)(.*)]
I've also tried [(penis)(large)(.*)]{1,} with no luck. Anyone a regex king
that could help me out? :)
--
"Prayer has no place in Public School, just like facts have no place in
organized religion." --The Simpsons
mdew Guest
-
Bernard El-Hagin #4
Re: regex help
mdew wrote:
> This isnt specifically a perl question [...]
So why the fook are you asking it here!?
--
Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'
Bernard El-Hagin Guest
-
Anno Siegel #5
Re: regex help
mdew <not@home.com> wrote in comp.lang.perl.misc:
Matching "this" or "that" in any order *can* be done in a single> This isnt specifically a perl question, I'm running squid, and running it
> through a regex. The question, I'm trying to filter out some spam/ad sites
> using regex, I started with the "Penis Enlarging" websites.
>
> I want to match "penis" and "enlarge" in any order, So far I've got
>
> [(penis)(large)(.*)]
> I've also tried [(penis)(large)(.*)]{1,} with no luck. Anyone a regex king
> that could help me out? :)
(Perl-) regex, but it's a nuisance and doesn't scale. Use an extra
regex for each word.
Anno
Anno Siegel Guest
-
mdew #6
Re: regex help
On Fri, 05 Sep 2003 12:17:38 +0000, Anno Siegel wrote:
I'm testing to 2 possibilities, to prevent legit websites from being> mdew <not@home.com> wrote in comp.lang.perl.misc:>>> This isnt specifically a perl question, I'm running squid, and running
>> it through a regex. The question, I'm trying to filter out some spam/ad
>> sites using regex, I started with the "Penis Enlarging" websites.
>>
>> I want to match "penis" and "enlarge" in any order, So far I've got
>>
>> [(penis)(large)(.*)]
>> I've also tried [(penis)(large)(.*)]{1,} with no luck. Anyone a regex
>> king that could help me out? :)
> Matching "this" or "that" in any order *can* be done in a single (Perl-)
> regex, but it's a nuisance and doesn't scale. Use an extra regex for
> each word.
unnecessarily filtered, I'm thinking of *penis*enlarge* and in reverse
*enlarge*penis*. Whats the proper regex way of doing this?
--
"Prayer has no place in Public School, just like facts have no place in
organized religion." --The Simpsons
mdew Guest
-
Vlad Tepes #7
Re: regex help
mdew <not@home.com> wrote:
print "Spam!" if (/penis enlarge/i || /enlarge penis/i );> On Fri, 05 Sep 2003 12:17:38 +0000, Anno Siegel wrote:>>> mdew <not@home.com> wrote in comp.lang.perl.misc:>>>>>
>>> I want to match "penis" and "enlarge" in any order, So far I've got
>>>
>>> [(penis)(large)(.*)]
>>> I've also tried [(penis)(large)(.*)]{1,} with no luck. Anyone a regex
>>> king that could help me out? :)
>> Matching "this" or "that" in any order *can* be done in a single (Perl-)
>> regex, but it's a nuisance and doesn't scale. Use an extra regex for
>> each word.
> I'm testing to 2 possibilities, to prevent legit websites from being
> unnecessarily filtered, I'm thinking of *penis*enlarge* and in reverse
> *enlarge*penis*. Whats the proper regex way of doing this?
--
Vlad
Vlad Tepes Guest
-
Sam Holden #8
Re: regex help
On Sat, 06 Sep 2003 00:48:45 +1200, mdew <not@home.com> wrote:
/enlarge/ || /penis/> On Fri, 05 Sep 2003 12:17:38 +0000, Anno Siegel wrote:
>>>> Matching "this" or "that" in any order *can* be done in a single (Perl-)
>> regex, but it's a nuisance and doesn't scale. Use an extra regex for
>> each word.
> I'm testing to 2 possibilities, to prevent legit websites from being
> unnecessarily filtered, I'm thinking of *penis*enlarge* and in reverse
> *enlarge*penis*. Whats the proper regex way of doing this?
Your just trying to make us use rudy words (like "enlarge") aren't you :)
--
Sam Holden
Sam Holden Guest
-
Abigail #9
Re: regex help
mdew (not@home.com) wrote on MMMDCLVII September MCMXCIII in
<URL:news:pan.2003.09.05.12.06.47.20627@home.com >:
[] This isnt specifically a perl question,
Then you shouldn't be asking here.
Goodbye.
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=> CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29 =>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$==-2449231+gm_julian_day+time);do{until($=<$#r){$_.=$ r[$#r];$=-=$#r}for(;
!$r[--$#r];){}}while$=;$,="\x20";print+$_=>September=>MCMXCI II=>=>=>=>=>=>=>=>'
Abigail Guest
-
Sam Holden #10
Re: regex help
On 5 Sep 2003 12:53:46 GMT, Sam Holden <sholden@flexal.cs.usyd.edu.au> wrote:
/enlarge/ && /penis/> On Sat, 06 Sep 2003 00:48:45 +1200, mdew <not@home.com> wrote:>>> On Fri, 05 Sep 2003 12:17:38 +0000, Anno Siegel wrote:
>>>>>>> Matching "this" or "that" in any order *can* be done in a single (Perl-)
>>> regex, but it's a nuisance and doesn't scale. Use an extra regex for
>>> each word.
>> I'm testing to 2 possibilities, to prevent legit websites from being
>> unnecessarily filtered, I'm thinking of *penis*enlarge* and in reverse
>> *enlarge*penis*. Whats the proper regex way of doing this?
> /enlarge/ || /penis/
Must stop posting late at night :(
--
Sam Holden
Sam Holden Guest
-
mdew #11
Re: regex help
On Fri, 05 Sep 2003 12:53:46 +0000, Sam Holden wrote:
I'm no big perl guru, but doesnt || mean "OR", so any url's with "enlarge"> On Sat, 06 Sep 2003 00:48:45 +1200, mdew <not@home.com> wrote:>>> On Fri, 05 Sep 2003 12:17:38 +0000, Anno Siegel wrote:
>>>>>>> Matching "this" or "that" in any order *can* be done in a single (Perl-)
>>> regex, but it's a nuisance and doesn't scale. Use an extra regex for
>>> each word.
>> I'm testing to 2 possibilities, to prevent legit websites from being
>> unnecessarily filtered, I'm thinking of *penis*enlarge* and in reverse
>> *enlarge*penis*. Whats the proper regex way of doing this?
> /enlarge/ || /penis/
>
> Your just trying to make us use rudy words (like "enlarge") aren't you :)
in the title would get mark as spam? how about,
(enlarge AND penis) OR (penis AND enlarge)
the OR could be ditched, for say to regex, am i looking at this the right
way?
--
"Prayer has no place in Public School, just like facts have no place in
organized religion." --The Simpsons
mdew Guest
-
samb1 #12
Regex help
Guys Iam parsing three wbsites for specific links using three different regex.
I have tested all three regex using a regex tester and they all give me the
desired results. My regex are located in an XML doc and I have a seperate CF
file that reads the doc and uses the regex from the XML. However when I place
the parse results into an array one of the regex returns nothing. I dont think
my regex is wrong as I have tested it could someone please take a look? Here is
my regex: href={{:punct:]]+id(.*?)[[:digit:]]+[[:punct:]] Here is an example of
the html i am parsing: <td><a hre='?id=3400305'> Thanks in advance
samb1 Guest



Reply With Quote

