Regular Expression Plugin

Great plugin, use it every day! However...

I've noticed that if you copy and paste text from the "Find Output"
window, to the "Pattern" window, the regular expression fails to
match. Yet, if you delete the text from the "Pattern" window and
retype it, the match works again. :S

Also, when handling large amounts of data - something that I need to
do regularly, the processor pegs at 100% and nothing short of a reboot
will allow me to regain access to the box.

Any ideas?

Cheers
Tony

6 comments

Hi Tony, can you give me a specific example of the cut-paste problem?

As for the large amount of data problem, my guess here is that it's
stuck compiling and matching the pattern. This happens in the
background every time a character is typed (though it is smart enough to
only do this once on a paste). I'm assuming that it's just taking a
very long time. Perhaps in this case it would be better if there was an
option to only perform the match when a button is pressed.

Guy

Tony Johnson wrote:

Great plugin, use it every day! However...

I've noticed that if you copy and paste text from the "Find Output"
window, to the "Pattern" window, the regular expression fails to
match. Yet, if you delete the text from the "Pattern" window and
retype it, the match works again. :S

Also, when handling large amounts of data - something that I need to
do regularly, the processor pegs at 100% and nothing short of a reboot
will allow me to regain access to the box.

Any ideas?

Cheers
Tony

0

Hah! Of course now that I want to prove it, I can't!

Ok - here's what to do. Use this text in the "Text" area:

Enterprise JavaBeans Technology In the "Pattern" area, type in: ]+> Should notice that both the tags are highlighted in the "Find Output" area. Select "Enterprise JavaBeans Technology" from the "Find Output" area and copy and paste it to the "Pattern" area. The pattern should now be: ]+>]]>Enterprise JavaBeans Technology

which should match the first tag and the text but it doesn't. Use the
DEL key to delete everything back to the end of "Enterprise" and then
it matches again. Type in " JavaBeans Technology" and it matches.

None of the options (Dotall, Multiline etc) are selected.

I've also noticed that sometimes the regex fails to match if you've
previously been using replace all, unchecked the replace all check-box
but left the replacement value in the "Replace" area. Sometimes I get
errors about groups not found, sometimes the match just doesn't work.
Delete the entry from the "Replace" area and it all works again.

The "Match" button would be a winner as well. There could be a "Live
Evaluation" checkbox or the like. It would also be nice if the text
area could be populated in a manner similar to the Regulator
http://royo.is-a-geek.com/iserializable/regulator/ where you can use a
file or a URL to populate the "Text" area.

One other thing (bet you wish I hadn't started now!) - if you could
change the fonts for the plugin, it would be great.

I'll go now! :)
Cheers
Tony




On Wed, 03 Mar 2004 10:31:10 -0800, Guy Gascoigne-Piggford
<guy@wyrdrune.com> wrote:

>Hi Tony, can you give me a specific example of the cut-paste problem?
>
>As for the large amount of data problem, my guess here is that it's
>stuck compiling and matching the pattern. This happens in the
>background every time a character is typed (though it is smart enough to
>only do this once on a paste). I'm assuming that it's just taking a
>very long time. Perhaps in this case it would be better if there was an
>option to only perform the match when a button is pressed.
>
>Guy
>

0

Hmm, well I can reproduce the problem, very strange. I'll get it fixed
and get back to you.

Guy

Tony Johnson wrote:

Hah! Of course now that I want to prove it, I can't!

Ok - here's what to do. Use this text in the "Text" area:

<a href=http://java.sun.com/products/ejb/>Enterprise JavaBeans
Technology</a>

In the "Pattern" area, type in:

<[^>]+>

Should notice that both the tags are highlighted in the "Find Output"
area. Select "Enterprise JavaBeans Technology" from the "Find Output"
area and copy and paste it to the "Pattern" area. The pattern should
now be:

<[^>]+>Enterprise JavaBeans Technology

which should match the first tag and the text but it doesn't. Use the
DEL key to delete everything back to the end of "Enterprise" and then
it matches again. Type in " JavaBeans Technology" and it matches.

None of the options (Dotall, Multiline etc) are selected.

I've also noticed that sometimes the regex fails to match if you've
previously been using replace all, unchecked the replace all check-box
but left the replacement value in the "Replace" area. Sometimes I get
errors about groups not found, sometimes the match just doesn't work.
Delete the entry from the "Replace" area and it all works again.

The "Match" button would be a winner as well. There could be a "Live
Evaluation" checkbox or the like. It would also be nice if the text
area could be populated in a manner similar to the Regulator
http://royo.is-a-geek.com/iserializable/regulator/ where you can use a
file or a URL to populate the "Text" area.

One other thing (bet you wish I hadn't started now!) - if you could
change the fonts for the plugin, it would be great.

I'll go now! :)
Cheers
Tony




On Wed, 03 Mar 2004 10:31:10 -0800, Guy Gascoigne-Piggford
<guy@wyrdrune.com> wrote:

>>Hi Tony, can you give me a specific example of the cut-paste problem?
>>
>>As for the large amount of data problem, my guess here is that it's
>>stuck compiling and matching the pattern. This happens in the
>>background every time a character is typed (though it is smart enough to
>>only do this once on a paste). I'm assuming that it's just taking a
>>very long time. Perhaps in this case it would be better if there was an
>>option to only perform the match when a button is pressed.
>>
>>Guy
>>


0

BTW I've tracked down this bug, though I don't really have a fix that I
want to release quite yet. However a brief description of the problem
may help you work around it a bit easier.

The Match window is displaying html. To keep the formatting correct we
replace all spaces with non-break spaces before we populate it. When
text is cut from that window, it gets placed on the clipboard in such a
way that the non-break spaces are retained and then when it's pasted
into the pattern window, the same non-break spaces get placed into the
pattern. To the user they look like perfectly normal spaces, but as far
as the regular expression is concerned they are a completely different
character.

I.e. if you type over the pasted spaces, then the pattern works correctly.

I spent a while yesterday looking at how I can fix this, but so far only
really have an ugly hack.

More later.

Guy

Tony Johnson wrote:

Hah! Of course now that I want to prove it, I can't!

Ok - here's what to do. Use this text in the "Text" area:

<a href=http://java.sun.com/products/ejb/>Enterprise JavaBeans
Technology</a>

In the "Pattern" area, type in:

<[^>]+>

Should notice that both the tags are highlighted in the "Find Output"
area. Select "Enterprise JavaBeans Technology" from the "Find Output"
area and copy and paste it to the "Pattern" area. The pattern should
now be:

<[^>]+>Enterprise JavaBeans Technology

which should match the first tag and the text but it doesn't. Use the
DEL key to delete everything back to the end of "Enterprise" and then
it matches again. Type in " JavaBeans Technology" and it matches.

None of the options (Dotall, Multiline etc) are selected.

I've also noticed that sometimes the regex fails to match if you've
previously been using replace all, unchecked the replace all check-box
but left the replacement value in the "Replace" area. Sometimes I get
errors about groups not found, sometimes the match just doesn't work.
Delete the entry from the "Replace" area and it all works again.

The "Match" button would be a winner as well. There could be a "Live
Evaluation" checkbox or the like. It would also be nice if the text
area could be populated in a manner similar to the Regulator
http://royo.is-a-geek.com/iserializable/regulator/ where you can use a
file or a URL to populate the "Text" area.

One other thing (bet you wish I hadn't started now!) - if you could
change the fonts for the plugin, it would be great.

I'll go now! :)
Cheers
Tony




On Wed, 03 Mar 2004 10:31:10 -0800, Guy Gascoigne-Piggford
<guy@wyrdrune.com> wrote:

>>Hi Tony, can you give me a specific example of the cut-paste problem?
>>
>>As for the large amount of data problem, my guess here is that it's
>>stuck compiling and matching the pattern. This happens in the
>>background every time a character is typed (though it is smart enough to
>>only do this once on a paste). I'm assuming that it's just taking a
>>very long time. Perhaps in this case it would be better if there was an
>>option to only perform the match when a button is pressed.
>>
>>Guy
>>


0

Guy,

Thanks for taking the time to look in to this. It's not a big drama
for me to replace each space in the expression, so I can live with
that until a new version comes out.

As an aside, I've had some .Net guys at work asking "where did you get
that awesome regex tester?" Told them to go install java and I'll show
em! :)

Cheers
Tony

On Fri, 05 Mar 2004 10:46:12 -0800, Guy Gascoigne-Piggford
<guy@wyrdrune.com> wrote:

>BTW I've tracked down this bug, though I don't really have a fix that I
>want to release quite yet. However a brief description of the problem
>may help you work around it a bit easier.
>
>The Match window is displaying html. To keep the formatting correct we
>replace all spaces with non-break spaces before we populate it. When
>text is cut from that window, it gets placed on the clipboard in such a
>way that the non-break spaces are retained and then when it's pasted
>into the pattern window, the same non-break spaces get placed into the
>pattern. To the user they look like perfectly normal spaces, but as far
>as the regular expression is concerned they are a completely different
>character.
>
>I.e. if you type over the pasted spaces, then the pattern works correctly.
>
>I spent a while yesterday looking at how I can fix this, but so far only
>really have an ugly hack.
>
>More later.
>
>Guy
>

0

rofl, thanks :)

Tony Johnson wrote:

Guy,

Thanks for taking the time to look in to this. It's not a big drama
for me to replace each space in the expression, so I can live with
that until a new version comes out.

As an aside, I've had some .Net guys at work asking "where did you get
that awesome regex tester?" Told them to go install java and I'll show
em! :)

Cheers
Tony

On Fri, 05 Mar 2004 10:46:12 -0800, Guy Gascoigne-Piggford
<guy@wyrdrune.com> wrote:

>>BTW I've tracked down this bug, though I don't really have a fix that I
>>want to release quite yet. However a brief description of the problem
>>may help you work around it a bit easier.
>>
>>The Match window is displaying html. To keep the formatting correct we
>>replace all spaces with non-break spaces before we populate it. When
>>text is cut from that window, it gets placed on the clipboard in such a
>>way that the non-break spaces are retained and then when it's pasted
>>into the pattern window, the same non-break spaces get placed into the
>>pattern. To the user they look like perfectly normal spaces, but as far
>>as the regular expression is concerned they are a completely different
>>character.
>>
>>I.e. if you type over the pasted spaces, then the pattern works correctly.
>>
>>I spent a while yesterday looking at how I can fix this, but so far only
>>really have an ugly hack.
>>
>>More later.
>>
>>Guy
>>


0

Please sign in to leave a comment.