As I note below, escape behavior is a little different because sed wants you to escape +'s to have the normal regex semantics ("one or more matches"). And I actually think Perl is correct here and you should only need to escape those characters if you want literal matches, but I have a weird environment (Cygwin) and it's possible the sed build there is a little messed up.
The major difference for me is that Perl can match across multiple lines using the -0777 flag. I've been doing a lot of regex-based mass manipulation of source code lately and most people write functions across multiple lines. You can't do that with sed without multi-line appending and it gets really ugly really fast. Sed is pretty much just single line matches only.
For example, I had 100-odd classes with getters for certain values but not setters. So I did:
grep -rle "getAddTime" | while read line; do if ! grep -q "setAddTime" $line ; then echo $line; perl -i -0777 -pe 's/public\s+Date\s+getAddTime\s*\(\s*\)\s*\{[\s\w=;]+\}/$&\n\n public void setAddTime(Date addTime) { this.addTime = addTime; }/' $line; fi done
translation: look for files that contain getAddTime, if they do not contain setAddTime then find the string "public Date getAddTime() {...} and append the setter after that". There are a few edge cases you could hit there but it was close enough to work on my codebase.I wish Perl would do an inplace edit of a file without creating a backup, though. I am under source control so there's no harm in just operating right on the files. It's not the end of the world to follow up with a rm -r *.bak I guess, but it's annoying. At least they're in my git-ignore which helps a little.
$ perldoc perlrun
(or http://perldoc.perl.org/perlrun.html)says:
> If no extension is supplied, and your system supports it, the original file is kept open without a name while the output is redirected to a new file with the original filename. When perl exits, cleanly or not, the original file is unlinked.
Which system are you using? With macOS and Linux, I get no automatic .bak extension when not providing a backup suffix, i.e. it behaves like you want under these systems.
Update: Apparently, anonymous files are not supported by Windows: http://stackoverflow.com/a/30539016 which would explain the behaviour you describe.
$ curl -sS 'https://www.google.com/complete/search?client=hp&hl=en&xhr=t&q=aurora' | jq . | gsed -nE '/<\/?b>/{s```g;s`"|,|^ *``g;p}'
(see my other comment about gsed vs sed) curl -sS 'https://www.google.com/complete/search?client=hp&hl=en&xhr=t&q=aurora' \
| json_pp | sed -nE '/<\/?b>/{s```g;s`"|,|^ *``g;p}'To run this with macOS, I had to use the GNU version of sed. I installed it with
$ brew install gnu-sed
And it is then called with 'gsed' instead of 'sed'.As an avid Perl programmer, I had json_pp in my $PATH - for everyone else - it is here: https://metacpan.org/pod/JSON::PP
You can install it with cpanm:
$ cpanm JSON::PP
If you don't have cpanm, you can install it with $ curl -L https://cpanmin.us | perl - App::cpanminus
The modified command line from above then becomes: $ curl -sS 'https://www.google.com/complete/search?client=hp&hl=en&xhr=t&q=aurora' \
| json_pp | gsed -nE '/<\/?b>/{s```g;s`"|,|^ *``g;p}'
Here is a little Bash function to encapsulate this: $ function c() { curl -sS "https://www.google.com/complete/search?client=hp&hl=en&xhr=t&q=$1" | json_pp | gsed -nE '/<\/?b>/{s```g;s`"|,|^ *``g;p}'; }
Which then allows you to use it like this: $ c hacker
hacker news
hacker typer
hackerrank
hackerman
hackers movie
hacker fare
hackerone
hackers cast
hacker pschorr
For spaces in your query, use a '+': $ c New+York
new york times
new york and company
new york giants
new york post
new york daily news
new york weatherhttp://neilk.net/blog/2000/06/01/abigails-regex-to-test-for-...
(check out Abigail's other JAPHs if you like stuff like this)
You can officially (as a matter of policy and enforced by iOS) distribute apps in 3 ways:
1. Through the App Store
2. As an enterprise developer distributing apps to employees of the same company through an enterprise App Store to an enterprise enrolled iOS device
3. As a developer to a test device where the test device is 1 out of 100 registered devices in your Apple developer account
The only other alternative I'm aware of is to jailbreak the device and distribute via Cydia.
But, AFAIK Apple centrally checks the validity of the profile with each download and thus they are certainly able to detect if you use your enterprise profile to circumvent the appstore.
I hope those countries have a plan B for when the majority of the world's car run on something else than oil.