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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:32:10+00:00 2026-05-29T05:32:10+00:00

my working in file parsing using Haskell, and I’m using both Data.Attoparsec.Char8 and Data.ByteString.Char8

  • 0

my working in file parsing using Haskell, and I’m using both Data.Attoparsec.Char8 and Data.ByteString.Char8. I want to parse an expression which can contains symbols like : – / [ ] _ . (minus, slashes, braquets and underscore).

I’ve write the following parser

import qualified Data.ByteString.Char8 as B
import qualified Data.Attoparsec.Char8 as A

identifier' :: Parser B.ByteString
identifier' = A.takeWhile $ A.inClass "A-Za-z0-9_//- /[/]"

… but it’s not works like expected.

ghc>  A.parse identifier' (B.pack "EMBXSHM-PortClo")
Done "-PortClo" "EMBXSHM"

ghc> A.parse identifier' (B.pack "AU_D[1].PCMPTask")
Done ".PCMPTask" "AU_D[1]"

can someone help me.

Thanks for your time.

  • 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-29T05:32:11+00:00Added an answer on May 29, 2026 at 5:32 am

    Take a look at the documentation: http://hackage.haskell.org/packages/archive/attoparsec/0.10.1.0/doc/html/Data-Attoparsec-ByteString-Char8.html#g:9

    To add a “-” to a set, place it a the beginning or end of a string.

    The latter doesn’t parse because you don’t have dots in your class listing.

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

Sidebar

Related Questions

I have an XML file which I want to convert into JSON file using
I'm working on application which has workflow like this: 1.parsing home page (using HttpURLConnection,
I'm working in C#/.NET and I'm parsing a file to check if one line
I been working on parsing out bookmarks from an export file generated by google
I working on adding file uploading to my web application. I'm using an iframe
With the sort of programs I write (working with raw file data) I often
I'm working on a project that involves parsing a large csv formatted file in
I'm writing a regular expression to match data from the IMDb soundtracks data file.
I am working on a log parsing script using Perl. I am reading the
I am working on a wrapper that parses a data file for an existing

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.