Page 1 of 1

help with Find and Replace

Posted: Wed Aug 11, 2010 3:33 pm
by DanZac
I haven't used the find and replace dialogue too much and I'm not even sure if what I want to do is possible.

I need to find occurrences of a word that are ALWAYS followed by space and then a digit, and replace JUST the word, not the space and digit.

So,

Matt 12.1 needs to be replaced with Mt. 12.1

But the digits will always be different, so I would use the digit element. Can I tell Mellel to leave the digit it finds?

Re: help with Find and Replace

Posted: Wed Aug 11, 2010 3:56 pm
by DanZac
Figured it out. About the only thing I want to say is that the Mellel Guide isn't particularly helpful for this

Re: help with Find and Replace

Posted: Wed Aug 11, 2010 4:38 pm
by rpcameron
DanZac wrote:Figured it out. About the only thing I want to say is that the Mellel Guide isn't particularly helpful for this
I'm curious, how were you able to do this? I tried constructing a FindSet that I thought would do, but it didn't find my test string.

I'd assume a regex would be:

Code: Select all

[a-zA-Z]+(\ \d)
Ah, after fiddling a bit in Mellel to make the FindSet mirror my regex, I was able to accomplish what you did. It's a bit awkward in Mellel, but it seems to mirror the regex pretty well. Glad you were able to figure it out. For those wondering, I came up with:
Image

Re: help with Find and Replace

Posted: Thu Aug 12, 2010 8:28 am
by donb
I try to deal with such issues in my Beginners Tutorial for Mellel, in the find and replace chapter. I'd appreciate your taking a look at that, and letting me know if the explanation of the method proves to be unsatisfactory.

Don Broadribb