Jump to content
Sign in to follow this  

StringRegExpReplace - wrong pattern

Recommended Posts

Hi guys!

I have text file with lines:

Good text - something
100 $ unnecessary text
Good text - something
Good text - something
Good text - something
080 $ unnecessary text

I want remove all line starting with:

3 digits + space + $ sign + any text.

I try:

StringRegExpReplace($sTextToReplace, '([0-9]{3})[:space:]\x{24}', "")

StringRegExpReplace($sTextToReplace, '(?-i[0-9]{3}[:space:]\x{24}(?s)', "")

Work great with:

StringRegExpReplace($sTextToReplace,"\d{3}\s\$.+", "")

Question Solved.

Edited by wojciech

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • By dascondor
      So basically need to pull text from a .txt file or .sql and use that text to replace something within a different file.
      First File:
      Text1 = jumps
      Text2 = fence
      Second File:
      My Dog XXXXX over the YYYYY.
      After Script:
      My Dog jumps over the fence
      I have found a good start, I'm basic programmer at best, I have some experience but this gets out of my wheel house.
      Any help is appreciated.
  • Create New...