[Novalug] regex help

Igor Birman igor_birman@yahoo.com
Fri Jul 4 08:02:15 EDT 2014


dn=cn.*

or if you want to explicitly set start and end of line, ^dn=cn.*$

I'm not actually sure what [^.]* is looking for.  I guess it's interpreting the dot as a literal period rather than any character.  And if it did interpret it as any character, you would be searching for 0 or more instances of anything that isn't a character.

Igor



On Thursday, July 3, 2014 11:46 PM, Roger W. Broseus <rogerb@bronord.com> wrote:
 


I'm trying to clean up a Thunderbird address book saved out in .ldif format. The objective is to clean out a lot of strings and just leave the "meat."

So, take a line that begins with

    dn: cn=

and is followed by arbitrary text including letters, numbers,
    punctuation marks, and characters like @ (as in an email address).

I constructed a search string like this,

    dn: cn=[^.]*

This should find "dn: cn=" followed by zero or more of any
    character. However, the search stumbles on periods, stopping
    immediately before them. And, a string may have zero or more periods
    in it.

Any suggestion on how to find an arbitrary string after the equal
    sign up to end of line? I can then search and replace with nothing
    and clean out a lot of cruft. Then I'll have a copy of my master
    email address book that I can easily search when my "home" T-burd is
    not available to me, e.g., when using a web interface. Export and
    import: I've been down that fruitless road before, not to mention,
    my client might be Squirrel mail, K-9 on my droid, gmail, or some
    other, depending on the circumstances.

-- 
--
Roger W. Broseus - Linux User Email: RogerB@bronord.com Web Site: www.bronord.com 
_______________________________________________
Novalug mailing list
Novalug@calypso.tux.org
http://calypso.tux.org/mailman/listinfo/novalug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.firemountain.net/pipermail/novalug/attachments/20140704/b17c10f0/attachment.htm>


More information about the Novalug mailing list