replaceText() not working as expected for multiple lines
Peter Haworth
pete at lcsql.com
Sat Sep 20 17:46:21 EDT 2014
You might try (?m) to switch on multiline mode at the start of your regex.
I'm pretty sure that won't work though. LC makes you use a repeat loop to
go through each line and issue the replaceText() against each one.
Hope that Thierry chimes in with a workaround for this - he's the LC regex
King.
Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>
On Sat, Sep 20, 2014 at 1:05 PM, Dr. Hawkins <dochawk at gmail.com> wrote:
> I have a variable with:
>
> /Users/hawk/bk_clients/blue aardvark/blue_aardvark____001.dhbk
> /Users/hawk/bk_clients/pink panther/pink_panther_____001.dhbk
> /Users/hawk/bk_clients/super chicken/super_chicken____005.dhbk
> /Users/hawk/bk_clients/test5/test5____________001.dhbk
>
> which was obtained with a shell command and ls on OSX
>
> Using replaceText() to replace ^/Users/hawk/bk_clients/ with empty, I get
>
> blue aardvark/blue_aardvark____001.dhbk
> /Users/hawk/bk_clients/pink panther/pink_panther_____001.dhbk
> /Users/hawk/bk_clients/super chicken/super_chicken____005.dhbk
> /Users/hawk/bk_clients/test5/test5____________001.dhbk
>
> That is, the ^ is only being applied to the variable as a whole, rather
> than to each line.
>
> Does this have to do with how livecode and OSX delimit lines?
>
> --
> Dr. Richard E. Hawkins, Esq.
> (702) 508-8462
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list