How to get a regular expression

user6236820

I have this expression

<h3 id="productPageRightSectionTop-authors-h3">de <a id="productPageRightSectionTop-author-lnk" data-id="2316">José Saramago</a>; Ilustração:  <a id="productPageRightSectionTop-entidade-lnk">João Caetano</a>&nbsp;</h3>

i made this one

<h3 id="productPageRightSectionTop-authors-h3">de <a id="productPageRightSectionTop-author-lnk" data-id="[0-9]+">(.+)</a>

but is getting everything and i just want this part

<a id="productPageRightSectionTop-author-lnk" data-id="2316">José Saramago</a>

Do you have any idea how i can do that?

ntotomanov

The problem is at the end of the regex:

data-id="[0-9]+">(.+)</a>

(.+) is too greedy and match everything afterwards. Changing that part to:

data-id="[0-9]+">[^<]*</a>

should fix the selection. The selector should look like:

<h3 id="productPageRightSectionTop-authors-h3">de <a id="productPageRightSectionTop-author-lnk" data-id="[0-9]+">[^<]*</a>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

How to get Captured Part of the Regular Expression in Nim

From Dev

How does an isolated regular expression get evaluated

From Dev

how to get individual parameters using regular expression

From Dev

How does an isolated regular expression get evaluated

From Dev

How to get square brackets with their elements with regular expression

From Dev

Regular expression (.NET): how to get a group in the middle

From Dev

How to get a name of created table with regular expression?

From Dev

How to get description with php regular expression?

From Dev

How to write regular expression to get the substring from the string using regular expression in c#?

From Dev

how to get html class values using regular expression in ruby

From Dev

How to get group name of match regular expression in Python?

From Dev

How to get JavaScript regular expression without the querying part?

From Dev

How to get a part of a string with a regular expression in a /bin/sh script

From Dev

How to get the days out of a string using Regular Expression in Python?

From Dev

How to get text contained between brackets with regular expression?

From Dev

How do i get the selected option Text using regular expression?

From Dev

How to get domain from a string using javascript regular expression

From Dev

How can I get the last match in regular extracor expression in jmeter?

From Dev

how to get data from a long text with regular expression

From Dev

How can you get the indices from a regular expression match?

From Dev

How to get secondlast element from URL using regular expression

From Dev

How to get numbers by using regular expression, but only last one

From Dev

How get only characters between `(` and `)` using regular expression?

From Dev

How to get domain from a string using javascript regular expression

From Dev

C# Regular expression: how to get one of two texts with condition?

From Dev

How could I get the last occurrence of [0] using regular expression?

From Dev

How to split this string and get the number separately in ios regular expression

From Dev

How to get string from parenthesis using regular expression in python

From Dev

how to get data from a long text with regular expression

Related Related

  1. 1

    How to get Captured Part of the Regular Expression in Nim

  2. 2

    How does an isolated regular expression get evaluated

  3. 3

    how to get individual parameters using regular expression

  4. 4

    How does an isolated regular expression get evaluated

  5. 5

    How to get square brackets with their elements with regular expression

  6. 6

    Regular expression (.NET): how to get a group in the middle

  7. 7

    How to get a name of created table with regular expression?

  8. 8

    How to get description with php regular expression?

  9. 9

    How to write regular expression to get the substring from the string using regular expression in c#?

  10. 10

    how to get html class values using regular expression in ruby

  11. 11

    How to get group name of match regular expression in Python?

  12. 12

    How to get JavaScript regular expression without the querying part?

  13. 13

    How to get a part of a string with a regular expression in a /bin/sh script

  14. 14

    How to get the days out of a string using Regular Expression in Python?

  15. 15

    How to get text contained between brackets with regular expression?

  16. 16

    How do i get the selected option Text using regular expression?

  17. 17

    How to get domain from a string using javascript regular expression

  18. 18

    How can I get the last match in regular extracor expression in jmeter?

  19. 19

    how to get data from a long text with regular expression

  20. 20

    How can you get the indices from a regular expression match?

  21. 21

    How to get secondlast element from URL using regular expression

  22. 22

    How to get numbers by using regular expression, but only last one

  23. 23

    How get only characters between `(` and `)` using regular expression?

  24. 24

    How to get domain from a string using javascript regular expression

  25. 25

    C# Regular expression: how to get one of two texts with condition?

  26. 26

    How could I get the last occurrence of [0] using regular expression?

  27. 27

    How to split this string and get the number separately in ios regular expression

  28. 28

    How to get string from parenthesis using regular expression in python

  29. 29

    how to get data from a long text with regular expression

HotTag

Archive