Community
    • Login

    Is this a bug or my regular expression is wrong?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 3 Posters 751 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Chris ChrisC
      Chris Chris
      last edited by

      I’m searching for the data below the Data and this regular expression can not find it

      ^Data\n(.+)\n(^[a-zA-Z(\n0-9[-\’$\Č\à,\Å:\é\Ü\Ö.\ö\ø\Ø\Ł ].\n)+(.(\btransitive verb|\btransitive and intransitive verb).\n)+(^[a-zA-Z (\n0-9[@-\’$\Č\à,\Å:\é\Ü\Ö.\ö\ø\Ø\Ł"].\n)+

      For example, the line spaces between the lines just below this sentence is three. It will not work.

      schoolwork to challenge able children
      <new line>
      <new line>
      <new line>
      transitive verb (past and past participle abled, present participle abling, 3rd person present singular ables) Caribbean

      However, if I change the line spaces to two, it works…

      schoolwork to challenge able children
      <new line>
      <new line>
      transitive verb (past and past participle abled, present participle abling, 3rd person present singular ables) Caribbean

      Is there something wrong with my regular expression that is causing this problem?

      Data
      able

      able
      adjective (comparative abler, superlative ablest)

      1. in position to do something: physically or mentally equipped to do something, especially because of circumstances and timing
        Were you able to reach her before she left?

      2. capable or talented: having the necessary resources or talent to do something
        a very able administrator

      3. education good at learning: quick to learn in an educational environment
        schoolwork to challenge able children

      transitive verb (past and past participle abled, present participle abling, 3rd person present singular ables) Caribbean

      1. be able to do something: to be able or have the ability to do something
      2. tolerate something: to put up with something

      [14th century. Via Old French (h)able < Latin habilis “easy to hold or handle” < habere “have, hold”]

      Word Key: Synonyms

      See intelligent.

      @@@

      PeterJonesP Alan KilbornA 2 Replies Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Chris Chris
        last edited by PeterJones

        @Chris-Chris said in Is this a bug or my regular expression is wrong?:

        Is there something wrong with my regular expression that is causing this problem?

        We cannot tell exactly what your regex is – we see bold and italics in your regex, which indicates there is some number of asterisks and/or underscores in the regex.

        I suggest you read the Formatting Forum Posts and Template for Search/Replace Questions entries (which were both linked in the Please Read Before Posting).

        In short, the advice is to please put example regexes between backticks, like `regex with *asterisks* or _underscores_`, which will render as regex with *asterisks* or _underscores_, and to put example data in between lines of three backticks ``` (which can be inserted using the </> button on the forum toolbar), as shown in those other pages.

        1 Reply Last reply Reply Quote 1
        • Alan KilbornA
          Alan Kilborn @Chris Chris
          last edited by

          @Chris-Chris

          Yea, for sure read and follow the template for posting such questions!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors