Discussion:
ANOTHER Regex Query
Steve Hodgson
2008-03-07 19:29:24 UTC
Permalink
Apologies for another Regex query. I'm hoping the expertise in
this group and the capabilities of BBEdit will solve a problem I have.

I have a number of PDF files generated from Word and the PDF
bookmarks contain dates that I want to strip out within a text
editor to change the bookmarks in one pass. I've done this in
the past very successfully but Acrobat/Word (2003) have changed
the way bookmarks are represented.

Basically I need to change something like:


R/Title(˛ˇ¿0¿1¿/¿0¿2¿/¿2¿0¿0¿8¿
¿S¿T¿T¿A¿ ¿D¿r¿i¿v¿e¿r¿ ¿U¿p¿d¿a¿t¿e)

To this:

R/Title(STTA Driver Update)

Where the ¿ character is actually a null character (H:00).
Previous version of the PDF generated with Acrobat 5.0 and Word
97 did not include the additional character - which I presume is
because of a move to Unicode.

Is there anyway to carry out a search and replace on this kind
of string. It does work correctly if I manually edit them.
--
Regards,

Steve Hodgson <mailto:***@shodgson.org.uk>
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <***@barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <bbedit-talk-***@barebones.com>
John Allen
2008-03-07 19:42:26 UTC
Permalink
I think the simplest way is just to do 'Zap Gremlins' under the text
menu. It wasn't clear from your message if you wanted the date that
remains to be removed or just the odd characters. Zap Gremlins
results in this:

R/Title(01/02/2008 STTA Driver Update)
John
R/Title(˛ˇ¿0¿1¿/¿0¿2¿/¿2¿0¿0¿8¿ ¿S¿T¿T¿A¿ ¿D¿r¿i¿v¿e¿r¿ ¿U¿p¿d¿a¿t¿e)
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <***@barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <bbedit-talk-***@barebones.com>
Fidelis Semper
2008-03-07 21:00:47 UTC
Permalink
Of course, Zap Gremlins won't strip away the date, so if you want
something more comprehensive to delete the date as well, highlight
the text to be changed, open BBEdit's "Find and Replace" dialog
sheet, disable "Start from Top", enable "Search Selection Only" and
provide ...

[0-9/˛ˇ\x00+¿]+

... in the "Search For:" box

and replace with nothing.

(The "\x00" is the hexadecimal equivalent to the red inverted
question mark displayed in BBEdit that is embedded throughout your
string.)

~Semper Fi, Mac!

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Post by John Allen
I think the simplest way is just to do 'Zap Gremlins' under the
text menu. It wasn't clear from your message if you wanted the
date that remains to be removed or just the odd characters. Zap
R/Title(01/02/2008 STTA Driver Update)
John
R/Title(˛ˇ¿0¿1¿/¿0¿2¿/¿2¿0¿0¿8¿ ¿S¿T¿T¿A¿ ¿D¿r¿i¿v¿e¿r¿ ¿U¿p¿d¿a¿t¿e)
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <***@barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <bbedit-talk-***@barebones.com>
Lewis@Gmail
2008-03-07 20:18:51 UTC
Permalink
Is there anyway to carry out a search and replace on this kind of
string. It does work correctly if I manually edit them.
Zap Gremlins in the Text menu should do this.

You can also search for the null and replace it with ''. I don't
recall the syntax, but I think copying the ¿ and pasting it into the
find/repalce worked (turn off grep)
--
The voice of the majority is no proof of justice.
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <***@barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <bbedit-talk-***@barebones.com>
Loading...