473,406 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

regular epression?

I used a regular expression and I want to find any sentences between "<script" and "</script?"
and the pattern I used it's here
String regstr=@"(<script((?!</script>)(\w|\W))+</script>)";

but it dosen't sometimes work...pls help me??



Nov 16 '05 #1
5 1102

"perspolis" <re*****@hotmail.com> wrote in message news:e6**************@TK2MSFTNGP10.phx.gbl...
I used a regular expression and I want to find any sentences between "<script" and "</script>"
and the pattern I used it's here
String regstr=@"(<script((?!</script>)(\w|\W))+</script>)";

but it dosen't sometimes work...pls help me??



Nov 16 '05 #2
"perspolis" <re*****@hotmail.com> wrote in
news:e6**************@TK2MSFTNGP10.phx.gbl...
I used a regular expression and I want to find any sentences between
"<script" and > "</script?"
and the pattern I used it's here
String regstr=@"(<script((?!</script>)(\w|\W))+</script>)";
but it dosen't sometimes work...pls help me??

Please don't post HTML-text if it isn't absolutely neccessary.

I've tried your regex (on this email's text), and it does seem to work.
Could you post sample data where it doesn't?

Niki
Nov 16 '05 #3
it works with most of pages...but with yahoo pages sometimes doesn't work..
I mean with yahoo pages it works but not completely..it doesn't return all
of
matches in yahoo pages...

"Niki Estner" <ni*********@cube.net> wrote in message
news:u7**************@TK2MSFTNGP09.phx.gbl...
"perspolis" <re*****@hotmail.com> wrote in
news:e6**************@TK2MSFTNGP10.phx.gbl...
I used a regular expression and I want to find any sentences between
"<script" and > "</script?"
and the pattern I used it's here
String regstr=@"(<script((?!</script>)(\w|\W))+</script>)";
but it dosen't sometimes work...pls help me??

Please don't post HTML-text if it isn't absolutely neccessary.

I've tried your regex (on this email's text), and it does seem to work.
Could you post sample data where it doesn't?

Niki

Nov 16 '05 #4
"perspolis" <re*****@hotmail.com> wrote in
news:OQ*************@TK2MSFTNGP11.phx.gbl...
it works with most of pages...but with yahoo pages sometimes doesn't
work..
I mean with yahoo pages it works but not completely..it doesn't return all
of
matches in yahoo pages...
If you could post a string where it doesn't work, I'd have a look at it.

If you only want general advices, here are a few:
- "\w|\W" does exactly the same as ".", it matches any character
- I'd use lazy quantifiers instead of negative lookahead (should be faster)
- This won't work if the script contains the text "</script>", e.g. in a
string or comment.

General advice (no offense meant): Always post all the information you have,
to increase your chances of getting help...

Niki

"Niki Estner" <ni*********@cube.net> wrote in message
news:u7**************@TK2MSFTNGP09.phx.gbl...
"perspolis" <re*****@hotmail.com> wrote in
news:e6**************@TK2MSFTNGP10.phx.gbl...
> I used a regular expression and I want to find any sentences between
> "<script" and > "</script?"
> and the pattern I used it's here
> String regstr=@"(<script((?!</script>)(\w|\W))+</script>)";
> but it dosen't sometimes work...pls help me??

Please don't post HTML-text if it isn't absolutely neccessary.

I've tried your regex (on this email's text), and it does seem to work.
Could you post sample data where it doesn't?

Niki



Nov 16 '05 #5
thx for ur helping :)
"Niki Estner" <ni*********@cube.net> wrote in message
news:OG**************@TK2MSFTNGP09.phx.gbl...
"perspolis" <re*****@hotmail.com> wrote in
news:OQ*************@TK2MSFTNGP11.phx.gbl...
it works with most of pages...but with yahoo pages sometimes doesn't
work..
I mean with yahoo pages it works but not completely..it doesn't return all of
matches in yahoo pages...
If you could post a string where it doesn't work, I'd have a look at it.

If you only want general advices, here are a few:
- "\w|\W" does exactly the same as ".", it matches any character
- I'd use lazy quantifiers instead of negative lookahead (should be

faster) - This won't work if the script contains the text "</script>", e.g. in a
string or comment.

General advice (no offense meant): Always post all the information you have, to increase your chances of getting help...

Niki

"Niki Estner" <ni*********@cube.net> wrote in message
news:u7**************@TK2MSFTNGP09.phx.gbl...
"perspolis" <re*****@hotmail.com> wrote in
news:e6**************@TK2MSFTNGP10.phx.gbl...
> I used a regular expression and I want to find any sentences between
> "<script" and > "</script?"
> and the pattern I used it's here
> String regstr=@"(<script((?!</script>)(\w|\W))+</script>)";
> but it dosen't sometimes work...pls help me??
Please don't post HTML-text if it isn't absolutely neccessary.

I've tried your regex (on this email's text), and it does seem to work.
Could you post sample data where it doesn't?

Niki



Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kenneth McDonald | last post by:
I'm working on the 0.8 release of my 'rex' module, and would appreciate feedback, suggestions, and criticism as I work towards finalizing the API and feature sets. rex is a module intended to make...
3
by: Jamie Pittman via AccessMonster.com | last post by:
I am having trouble bellow wit this query. I have the total regular hours and the overtime. The problem is that if it is 8 hours and under, I need it to show as regular hours. Any thoughts? ...
7
by: Billa | last post by:
Hi, I am replaceing a big string using different regular expressions (see some example at the end of the message). The problem is whenever I apply a "replace" it makes a new copy of string and I...
25
by: Mike | last post by:
I have a regular expression (^(.+)(?=\s*).*\1 ) that results in matches. I would like to get what the actual regular expression is. In other words, when I apply ^(.+)(?=\s*).*\1 to " HEART...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.