At 12:23 -0700 10/23/11, Ken Lanxner wrote:
>[email protected] (Marek Stepanek) wrote on  10/23/11  3:38 AM
>
>>On 05.01.2011 10:45 AM, Ken Lanxner wrote:
>>>Hi.
>>>
>>>How do I write a pattern to match a string that must contain 1 or more
>>>tabs and may also contain 1 or more spaces --- in any order.
>>>
>>>These would match:
>>>
>>>tab
>>>tab tab
>>>tab space tab
>>>space tab tab
>>>tab space tab space
>>>
>>>but a string of just 1 or more spaces would not match.
>>Try with this:
>>
>>^(\t|\t\t|\t \t| \t\t|\t \t )$
>
>Thanks, Marek. With  ^ and $ I get zero matches. Without them, I only match 
>pairs of tab space, in that order. It fails to find space tab. And not at all 
>for longer strings with multiple tabs and spaces.


These are so much fun...

[ \t]*?\t[ \t]*

any number of spaces or tabs, including none of them, followed, without being 
greedy, by a required tab and some more spaces or tabs.

whonoze?  All regular expressions are experimental and they often depend on the 
software reading them.

I worry about possibly making the second [ \t] not greedy. Ask Larry???
-- 

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