Regular expression does not match full string

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • andys19
    Visitor
    • Aug 2018
    • 3

    Regular expression does not match full string

    I have a script that will exclude PDF page numbers, but it compares the last digit.
    My script regular expression in my script: Page\s+\d+\s+of\s+\d+

    The text in file1: CONFIDENTIAL Page 3 of 111
    The text in file2: CONFIDENTIAL Page 3 of 119

    Note that the last digit of each string is RED
    I tried "Page\s+\d+\s+of\s+\d\d\d" but got the same results
  • Aaron
    Team Scooter
    • Oct 2007
    • 15945

    #2
    Hello,

    The regular expression looks ok. How did you define it in BC3, and did you mark the grammar element as unimportant?

    After the element is defined, you also need to uncheck the element name to make it unimportant:
    http://www.scootersoftware.com/suppo..._unimportantv3
    Aaron P Scooter Software

    Comment

    • andys19
      Visitor
      • Aug 2018
      • 3

      #3
      Thank you, that worked. However, now when my grammar string is on an orphaned line (either on the left side or the right side), it shows up as important. Can I fix this?

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 15945

        #4
        Hello,

        An unimportant grammar element should be unimportant even if on an orphan line. If you click the blinking cursor into the text, is this text detecting as the correct grammar element or a different one (bottom status bar of each pane shows the name of the grammar element the blinking cursor is within).

        Or, under the Session menu -> Session Settings, Importance tab, is "orphan lines are always important" enabled?
        Aaron P Scooter Software

        Comment

        • andys19
          Visitor
          • Aug 2018
          • 3

          #5
          I've tried "orphan lines are always important" checked and unchecked and got the same results. I reload after each change. When I click on the text of the orphaned line, I see my grammar name. This grammar works on lines that are not orphaned. I want to mark as unimportant any line that has matching grammar text, whether it's orphaned or not orphaned. ... I'm getting closer

          Comment

          • Aaron
            Team Scooter
            • Oct 2007
            • 15945

            #6
            Hello,

            The Orphan lines are always important should be unchecked. If you are still having trouble, could you email us:
            1) A pair of sample files
            2) A full screen screenshot
            3) Your BCSupport.zip from the Help menu -> Support; Export
            4) a link back to this forum thread

            We should be able to recreate the screenshot with your files and bcsupport.zip, to figure out what is going on.
            Aaron P Scooter Software

            Comment

            Working...