Discussion:
newbie question: what is the right syntax to remove all between txt1 and txt2
DB
2007-10-27 23:00:59 UTC
Permalink
hello.

what is the right syntax with EditPlus to replace everything between
two text strings ??


bla bla txt1 ***** any number of any text strings here including
linebreaks special chars, non-ascii chars ***** txt2 yada yada

would become

bla yada


with regular expressions on of course, I tried to replace


txt1 *. txt2

with

txt3


but this does not work





http://www.editplus.com
DZ-Jay
2007-10-28 11:14:48 UTC
Permalink
Post by DB
with regular expressions on of course, I tried to replace
txt1 *. txt2
with
txt3
The star is the quantifier, so your regexp is saying "txt1" followed by
0 or more spaces, followed by any one character, followed by a single
space, followed by txt2".

txt1( .+)? txt2

dZ.
--
DZ vs. The World:
Hating anything, everything and everyone since 1996.



http://www.editplus.com
Mahmoud Hammoud
2007-10-29 05:05:13 UTC
Permalink
thank you very much DZ

tell me please:


in the following example



<td class="alt1" title="ÇáÍãÏ ááå ÑÈø ÇáÚÇáãíä

ÇáÍãÏ ááå æÇáÕáÇÉ æÇáÓáÇã Úáì ÑÓæá Çááå æÚáì Âáå æÕÍÈå ÇáØíÈíä ÇáØÇåÑíä



ÇáÇÓÊÎáÇÝ ÇáÃÍßÇã ÕÍíÍ ÇáÈÎÇÑí">
<div>



What regexp would allow EditPlus to recognize all the title tag?

that is everything between

title="

till the first occurence of

">
Post by DZ-Jay
Post by DB
with regular expressions on of course, I tried to replace
txt1 *. txt2
with
txt3
The star is the quantifier, so your regexp is saying "txt1" followed by
0 or more spaces, followed by any one character, followed by a single
space, followed by txt2".
txt1( .+)? txt2
dZ.
--
Hating anything, everything and everyone since 1996.
[Non-text portions of this message have been removed]



http://www.editplus.com
Aleem Juma
2007-10-29 07:09:51 UTC
Permalink
Mahmoud,

Recognise with the following regexp

title="([^"]*)"


Aleem
Post by Mahmoud Hammoud
thank you very much DZ
in the following example
<td class="alt1" title="الحمد لله ربّ العالمين
الحمد لله والصلاة والسلام على رسول الله وعلى آله وصحبه الطيبين الطاهرين
الاستخلاف الأحكام صحيح البخاري">
<div>
What regexp would allow EditPlus to recognize all the title tag?
that is everything between
title="
till the first occurence of
">
Post by DZ-Jay
Post by DB
with regular expressions on of course, I tried to replace
txt1 *. txt2
with
txt3
The star is the quantifier, so your regexp is saying "txt1" followed by
0 or more spaces, followed by any one character, followed by a single
space, followed by txt2".
txt1( .+)? txt2
dZ.
--
Hating anything, everything and everyone since 1996.
[Non-text portions of this message have been removed]
http://www.editplus.com
Yahoo! Groups Links
http://www.editplus.com
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/editplus/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/editplus/join
(Yahoo! ID required)

<*> To change settings via email:
mailto:editplus-***@yahoogroups.com
mailto:editplus-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
editplus-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subjec
Mahmoud Hammoud
2007-10-29 10:52:10 UTC
Permalink
thank you Aleem,

I tried

title="([^"]*)"

the solution was provided kindly by DZ

title=("[^"]*|\n)"
Post by Aleem Juma
Mahmoud,
Recognise with the following regexp
title="([^"]*)"
Aleem
Post by Mahmoud Hammoud
thank you very much DZ
in the following example
<td class="alt1" title="ÇáÍãÏ ááå ÑÈø ÇáÚÇáãíä
ÇáÍãÏ ááå æÇáÕáÇÉ æÇáÓáÇã Úáì ÑÓæá Çááå æÚáì Âáå æÕÍÈå ÇáØíÈíä ÇáØÇåÑíä
ÇáÇÓÊÎáÇÝ ÇáÃÍßÇã ÕÍíÍ ÇáÈÎÇÑí">
<div>
What regexp would allow EditPlus to recognize all the title tag?
that is everything between
title="
till the first occurence of
">
Post by DZ-Jay
Post by DB
with regular expressions on of course, I tried to replace
txt1 *. txt2
with
txt3
The star is the quantifier, so your regexp is saying "txt1" followed
by
Post by Mahmoud Hammoud
Post by DZ-Jay
0 or more spaces, followed by any one character, followed by a single
space, followed by txt2".
txt1( .+)? txt2
dZ.
--
Hating anything, everything and everyone since 1996.
[Non-text portions of this message have been removed]
http://www.editplus.com
Yahoo! Groups Links
http://www.editplus.com
Yahoo! Groups Links
[Non-text portions of this message have been removed]



http://www.editplus.com

DZ-Jay
2007-10-29 10:14:22 UTC
Permalink
I think I see the problem: I think EditPlus does not match a new line
within character ranges or the ".". You could alternatively try:

title=("[^"]*|\n)"

But I believe EditPlus' regexp engine is non-conditionally greedy, and
will match all the new lines until the last quotation mark. I'd give
it a go regardless. Let me know if it works.

dZ.
Post by Mahmoud Hammoud
thank you very much DZ
in the following example
<td class="alt1" title="ÇáÍãÏ ááå ÑÈø ÇáÚÇáãíä
ÇáÍãÏ ááå æÇáÕáÇÉ æÇáÓáÇã Úáì ÑÓæá Çááå æÚáì Âáå æÕÍÈå ÇáØíÈíä
ÇáØÇåÑíä
ÇáÇÓÊÎáÇÝ ÇáÃÍßÇã ÕÍíÍ ÇáÈÎÇÑí">
<div>
What regexp would allow EditPlus to recognize all the title tag?
that is everything between
title="
till the first occurence of
">
--
DZ vs. The World:
Hating anything, everything and everyone since 1996.



http://www.editplus.com
Mahmoud Hammoud
2007-10-29 10:37:31 UTC
Permalink
thank you very much DZ!!!

you made my day!!!!


it works!!!!!

this is exactly what I needed

title=("[^"]*|\n)"
I think I see the problem: I think EditPlus does not match a new line
title=("[^"]*|\n)"
But I believe EditPlus' regexp engine is non-conditionally greedy, and
will match all the new lines until the last quotation mark. I'd give
it a go regardless. Let me know if it works.
dZ.
Post by Mahmoud Hammoud
thank you very much DZ
in the following example
<td class="alt1" title="ÇáÍãÏ ááå ÑÈø ÇáÚÇáãíä
ÇáÍãÏ ááå æÇáÕáÇÉ æÇáÓáÇã Úáì ÑÓæá Çááå æÚáì Âáå æÕÍÈå ÇáØíÈíä
ÇáØÇåÑíä
ÇáÇÓÊÎáÇÝ ÇáÃÍßÇã ÕÍíÍ ÇáÈÎÇÑí">
<div>
What regexp would allow EditPlus to recognize all the title tag?
that is everything between
title="
till the first occurence of
">
--
Hating anything, everything and everyone since 1996.
[Non-text portions of this message have been removed]



http://www.editplus.com
DZ-Jay
2007-10-29 10:50:51 UTC
Permalink
Post by Mahmoud Hammoud
thank you very much DZ!!!
you made my day!!!!
it works!!!!!
this is exactly what I needed
title=("[^"]*|\n)"
I'm glad it worked. Did you read my other message explaining Regular
Expressions? That should get you going for the next time.

dZ.
--
"Bastard Operators don't just win. Anyone can win. Bastard Operators
win and totally demoralise. That's real winning."

-- BOfH



http://www.editplus.com
Loading...