2 replies
I am trying to remove all txt from a wordpress site i have cobbled some code together and tried it one regex checker site and all seems to work .but not on interconnectit script to remove txt

Im tring to remove the txt between

<div class="entry-content">

And

<div class="powerpress_player" id="powerpress_player_4672">

the last tag the number at the end (4672) changes on post


I came up with
(?<=\<div class="entry-content">(.+)((\s)+(.+))+<div class="powerpress_player" id="powerpress_player_?)

It worked on regex101 but not in the script

Can anybody please give me some advice thans
#regex
Avatar of Unregistered
  • Profile picture of the author animositas
    There are many flavors of regexp. What programming language is your code written in?

    It's unclear to me if you're trying to extract/scrape the data between those 2 div tags or trying to delete it? (The reason I'm asking you this is because you say at the top of your post that you're trying to remove text but then the regexp that you're trying out is a "capture" )

    One thing that trips up a lot of people when building regexps is that the pattern normally works over one line of text only. As soon as the regexp engine encounters a \n (new line) character it starts the match again. You'll need to toggle a setting on the regexp engine to tell it to match over multiple lines.
    {{ DiscussionBoard.errors[11330109].message }}
  • Profile picture of the author acorbelli
    Is this the pattern as you entered it onto regex101?

    What content did you test it against?

    What language are you using?

    How are you making the regex call, and how are you using this pattern?

    What, specifically, would you like the end result content to be based on your example content?
    {{ DiscussionBoard.errors[11344866].message }}
Avatar of Unregistered

Trending Topics