On 2011-05-10, Robert Huttinger wrote:
oh!! do I need (link|visited|hover|active) ?
That would work for those. But I suggest that you re-read my
previous post, in which I suggested that you change only one
character from the regular expression in your earlier try:
Change the script line that is now
s/([-a-z ]+:)\s+(.+)/sprintf("%-20s",$1) . "$2"/ie;
to
s/([-a-z ]+:)\s*(.+)/sprintf("%-20s",$1) . "$2"/ie;
The change is the '*' after the '\s'. The '+' made it require at
least one space after the colon; using '*' allows it to match
with zero or more spaces. Your sample had no spaces after the
colon, which is why the original script didn't work for you.
The part of the above that you've been changing stays way more
general in what it will match if you leave it as '[-a-z ]+' (no
quotes). This character class includes all lower case letters
plus '-' and ' '; the '+' after it allows it to match one or
more times; the 'i' after the last '/' makes the expression
case-insensitive, so this will also match upper case letters.
Incidentally, this matching stuff ('regular expressions' in
geek-eze), is described well in BBEdit's manual. BBEdit's
regular expression matching follows that of Perl (5) quite closely.
bo
On Tue, May 10, 2011 at 4:20 PM, Ronald J Kimball <[email protected]> wrote:
On Mon, May 09, 2011 at 10:29:55AM -0400, Robert Huttinger wrote:
> s/([-a-z ]+:([^link|visited|hover|active]))\s*(.*)/sprintf("%-32s",$1) .
"$3"/ie;
FYI, [^link|visited|hover|active] does not do what I presume you think it
does. [] is a character class, which matches exactly one character.
[^link|visited|hover|active] matches any one character that is not one of
the following: acdehiklnorstv|
Ronald
--
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>
- Bruce
_bruce__van_allen__santa_cruz_ca_
--
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>