Re: Regex in OS X
Re: Regex in OS X
- Subject: Re: Regex in OS X
- From: Walter Ian Kaye <email@hidden>
- Date: Fri, 6 Feb 2004 14:26:50 -0800
At 03:59p -0500 02/06/2004, Hanaan Rosenthal didst inscribe upon an
electronic papyrus:
I'm having to deal with searching through text containing thousands of
lines for matches.
The text is tab delimited, where one field contains the wrong word and
the second contains the right word. I'm using it as the dictionary for
search and replace.
The text looks like that:
"GM General Motors
Macdonalds McDonalds
MicroSoft Microsoft
etc..."
I know Satimage has some regular expressions to handle such a thing.
Would anyone (Emmanuel) have some code that will return the line that
contains a match at the start of the line. Example:
Search string: "Macdonalds"
Result is the line:
"Macdonalds McDonalds"
Since it starts with the search string.
`grep` will do what you want, and you can call it via 'do shell script'.
check out `man grep` to study the syntax.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
References: | |
| >Regex in OS X (From: Hanaan Rosenthal <email@hidden>) |