At 15:01 -0700 7/15/11, TJ Luoma wrote:
>I'm trying to make a find/replace which will get rid of "any
>whitespace at the end of lines"
>
>If I turn on "grep" and search for:
>
>( |\t)$
>
>[that's one blank space after the (
>
>So I can run this and tell it to replace with "nothing" and it works.
>
>HOWEVER:
>
>If there are _multiple_ tabs or spaces (or, heaven forbid: tabs AND
>spaces, or spaces AND tabs) at the end of the line, I have to keep
>running this over and over again.
>
>I tried adding "*" like this:
>
>( *|\t*)$
>
>and this
>
>( |\t)*$
>
>but that didn't work (it matches every EOL regardless of whether it is
>a tab or space)


perl recognizes \s as a single white space character  \s* would be 0 to 
infinity of them

\s*\r$

ought to do the trick.

\s*$

is worth a try which is the way most all of that regular expression stuff works.
-- 

--> From the U S of A, the only socialist country that refuses to admit it. <--

-- 
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