On Saturday, April 15, 2017 at 5:03:22 PM UTC+2, Bruce Van Allen wrote: > On 4/15/17 at 7:23 AM, [email protected] <javascript:> (Bruce Van Allen) > wrote: > That pattern matches zero or more spaces/tabs > > ADDED: It also removes blank lines. If you were concerned > exclusively with spacebar spaces, change the pattern to > "(^ *| *$)" > > Or, remove spaces and tabs using > "(^[ \t]*|[ \t]*$)" > > > To match any whitespace except newlines you can use the Unicode class `\h` for “horizontal whitespace”, for example `^\h+|\h+$`. This works in Perl and BBEdit, but I haven’t tested it with Satimage or AppleScriptObjC.
If it doesn’t work, try `^[[:blank:]]+|[[:blank:]]+$`, or as a last recourse `^[^\S\r\n]+|[^\S\r\n]+$`. All of those match also non-regular spaces (for example en-spaces, thin spaces, etc.) and tabs. – Tom -- This is the BBEdit Talk public discussion group. 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> --- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/bbedit.
