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 598325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:22:35+00:00 2026-05-13T16:22:35+00:00

I am using Ply to interpret a FORTRAN format string. I am having trouble

  • 0

I am using Ply to interpret a FORTRAN format string. I am having trouble writing a regex to match the ‘H’ edit descriptor which is of the form

xHccccc …

where x specifies the number of characters to read in after the ‘H’

Ply matches tokens with a single regular expression, but I am having trouble using regular expression to perform the above. I am looking for something like,

(\d+)[Hh].{\1}

where \1 is parsed as an integer and evaluated as part of the regex – however it isn’t.

It seems that it is not possible to use matched numbers later in the same regex, is this the case?

Does anyone have any other solutions that might use Ply?

  • 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-05-13T16:22:35+00:00Added an answer on May 13, 2026 at 4:22 pm

    Regex can’t do things like that. You can hack it though:

    (1[Hh].|2[Hh]..|3[Hh]...|etc...)
    

    Ugly!

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

Sidebar

Related Questions

I am writing a parser using ply that needs to identify FORTRAN string literals.
I'm writing a C parser using PLY, and recently ran into a problem. This
I recently wrote a parser in Python using Ply (it's a python reimplementation of
Using ASP.NET MVC there are situations (such as form submission) that may require a
I am using Python with PLY to parse LISP-like S-Expressions and when parsing a
I'm using an older version of PLY that uses the md5 module (among others):
I'm writing a Connect4 game with an AI opponent using adversarial search techniques and
Using an access token with offline_access (which I believe is the ultimate and most
Using the below XML, I need to figure out which person worked more hours
Using online interfaces to a version control system is a nice way to have

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.