Dave Ratcliffe <[email protected]> sez:

>I'm trying to replace the following sort of strings in a very large
>text file (where "some_text" is one or more of any group of printable
>characters, and "$" is eol):
>
[example elided]
>
>And I'm trying, unsuccessfully, to remember how to write the
>expression in the Find: text box of the Find window that uses the '^'
>character in both forms as "beginning-of-line" and as the "not"
>operator.

In general, ^ means "beginning of line" when you use it directly within the
pattern, and means "not" when you start a character class with it.

For example, ^foo$ will match any line whose contents are "foo", while
[^aeiou] will match any character which is not a vowel.

(Please see Chapter 8 of the PDF manual: Help -> User Manual for more
details on this, and lots of related info. :-)

In this specific case:

>In English, it would be writing a regular expression for
>something like:
>
>For every occurrence of not-the-beginning-of-line, followed by "</p>",
>insert a line feed in front of "</p>".
>

since by default . does not match linebreaks, you can do this:

search for:     (.)</p>

replace with:   \1\r</p>


Regards,

 Patrick Woolsey
==
Bare Bones Software, Inc.                        <http://www.barebones.com>
P.O. Box 1048, Bedford, MA 01730-1048

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to