Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8555819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:12:39+00:00 2026-06-11T15:12:39+00:00

I find the following statement in a perl (actually PDL) program: /\/([\w]+)$/i; Can someone

  • 0

I find the following statement in a perl (actually PDL) program:

/\/([\w]+)$/i;

Can someone decode this for me, an apprentice in perl programming?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:12:40+00:00Added an answer on June 11, 2026 at 3:12 pm

    Sure, I’ll explain it from the inside out:

    \w – matches a single character that can be used in a word (alphanumeric, plus ‘_’)

    [...] – matches a single character from within the brackets

    [\w] – matches a single character that can be used in a word (kinda redundant here)

    + – matches the previous character, repeating as many times as possible, but must appear at least once.

    [\w]+ – matches a group of word characters, many times over. This will find a word.

    (...) – grouping. remember this set of characters for later.

    ([\w]+) – match a word, and remember it for later

    $ – end-of-line. match something at the end of a line

    ([\w]+)$ – match the last word on a line, and remember it for later

    \/ – a single slash character ‘/’. it must be escaped by backslash, because slash is special.

    \/([\w]+)$ – match the last word on a line, after a slash ‘/’, and remember the word for later. This is probably grabbing the directory/file name from a path.

    /.../ – match syntax

    /.../i – i means case-insensitive.

    All together now:

    /\/([\w]+)$/i; – match the last word on a line and remember it for later; the word must come after a slash. Basically, grab the filename from an absolute path. The case insensitive part is irrelevant, \w will already match both cases.

    More details about Perl regex here: http://www.troubleshooters.com/codecorn/littperl/perlreg.htm

    And as JRFerguson pointed out, YAPE::Regex::Explain is useful for tokenizing regex, and explaining the pieces.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think i can´t find my (obvious stupid) error :-). Following SELECT statement on
I have the following statement: if ($(this).find(option[text='My Cool Option1']).is(:selected)) //do something basically I have
i am using the following statement. $users = $this->User->find('all'); But in the database there
I'm wondering if I can do the following: Find a bookmark within a document
I use following statement to find number of table rows, it works fine in
Google-fu is failing me on this one. Can anyone briefly explain what the following
I have the following sql statement - it's trying to find all the zipcodes
I have written the following linq statement but I can't help feeling it could
I have the following statement to find unambiguous names in my data (~1 Million
I cannot find the syntax error in the following statement: CREATE TABLE dbo.statslogsummary as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.