DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Extract ascii  (Read 17,236 times)

harryray

  • Participant
  • Joined in 2018
  • *
  • Posts: 2
Extract ascii
« on: May 09, 2018, 03:05 PM »
Is there a search string so that I can use regexcaptor to extract just ascii characters from a file?...I currently use a couple of programmes called bintext and extracttext to do this.

I have absolutely no idea how to write a regex!!

Thanks

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
Re: Extract ascii
« Reply #1 on: May 09, 2018, 07:05 PM »
Well, the simplest regex to extract textual content as 'words' from (binary) files would be: \w+
If you only want alphanumeric characters (no accent- or punctuation- characters), that could be something like [a-zA-Z0-9]+

A great site to learn about and try out Regular Expressions has been https://regex101.com for me, with an extended explanation of what's going on with the regex you're trying, and an index of all expression elements available.
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

Original address: https://www.donationcoder.com/forum/index.php?topic=45514.0