Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to run perl command in the DOS box

Featured Replies

I installed wingnu32 and perl and I try to run such command that should get Title from tags <title>Title</title>

I am not sure, is it possible to run this program in cmd? Maybe I have wrong quoting? I tried few things

1.
for /f "delims=" %a in ('dir /b *.a') do (
pcretest.exe -nle 'print $& if /(?<=title>).*(?=<\/title)/' < %a
)

2.
for /f "delims=" %a in ('dir /b *.a') do (
pcretest.exe -ln0e '$,="\n";print /(?<=<title>).*?(?=<\/title)/sg' < %a
)

3.
for /f "delims=" %a in ('dir /b *.a') do (
%a | pcretest.exe -nle 'print $& if /(?<=title>).*(?=<\/title)/'
)

but I am getting error like: > not expected here...


For all instances in CMD scripts, use %%a in place of %a. ;)

  • Author

For all instances in CMD scripts, use %%a in place of %a. ;)

Sure but this is not batch script, this is directy in CMD, so this %a is correct.

Edited by DosCode

I wouldn't use pcretest there but sed from the unixtools:

for /f "delims=" %a in ('dir /b *.a') do (type %a | sed.exe -n "s/<title>\(.*\)<\/title>/\1/Ip")

  • Author

I wouldn't use pcretest there but sed from the unixtools:

for /f "delims=" %a in ('dir /b *.a') do (type %a | sed.exe -n "s/<title>\(.*\)<\/title>/\1/Ip")

Thanks. I didn't like sed because it seemed too hard to understand it, but this example with regex looks really simple and understandable.

Just make sure that you are searching for a title tag

  • <Title>Required Title Text</TITLE>
    or a title with attribute tag
  • <title="My Title">Required Title Text</TITLE>

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.