Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
any regex pros here?
#8
Here's one way to do it in Perl (there are many ways, most superior to this).
In the Terminal:

(First be sure we're in the Bourne shell, not csh or bash)
% sh
sh-3.2$

sh-3.2$ ( echo Location ; echo Inspections_Selected::Inspector ) | perl -e 'while ( <> ) {; print if s/(?:\b\w+::\b)?(.*)$/$1/; };'
Location
Inspector
sh-3.2$

Ugly. Sorry.
Reply


Messages In This Thread
any regex pros here? - by wolfcry911 - 10-17-2008, 09:11 PM
Re: any regex pros here? - by TheCaber - 10-17-2008, 09:52 PM
Re: any regex pros here? - by wolfcry911 - 10-17-2008, 09:59 PM
Re: any regex pros here? - by Seacrest - 10-17-2008, 09:59 PM
Re: any regex pros here? - by wolfcry911 - 10-17-2008, 10:06 PM
Re: any regex pros here? - by wolfcry911 - 10-18-2008, 12:23 AM
Re: any regex pros here? - by TheCaber - 10-18-2008, 01:41 AM
Re: any regex pros here? - by TheCaber - 10-18-2008, 02:13 AM
Re: any regex pros here? - by wolfcry911 - 10-18-2008, 01:53 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)