GRY-Online.pl --> Archiwum Forum

Regularne wyrażenie w JS - ktoś pomoże? :)

18.10.2008
16:10
smile
[1]

Grzesiek [ www eRepublik com PL ]

Regularne wyrażenie w JS - ktoś pomoże? :)

Mam taki o to string:

"question": "When the percentage change in quantity demanded is greater than the percentage change in price, the demand for the good is _.",
"answers": [
"perfectly inelastic",
"inelastic",
"elastic",
"unit elastic" ]
›,

I chciałbym wydobyć z niego tylko to, co się znajduje między:
"question": "
a
","answers":

Czyli tylko:
When the percentage change in quantity demanded is greater than the percentage change in price, the demand for the good is _.

Walczę w RegexBuddy, ale bez rezultatów.
Mam tylko to:

[^\"question\"]

:P

Pomógłby ktoś? :)

18.10.2008
16:14
[2]

Katane [ Rainwalker ]

Jak dla mnie to string.Replace()

18.10.2008
16:17
[3]

pecet007 [ - ]

takie nie styknie?

"question": "(.*?)",

18.10.2008
16:17
[4]

Grzesiek [ www eRepublik com PL ]

No tak, tylko potrzebuję wyrażenia regularnego ...


Edit:

pecet007

No może być, tylko zaznacza też "question" ;P

Wiem, że napisałeś, tylko jednocześnie posty poszły :)


Okie, poradzę sobie już :)

18.10.2008
16:18
[5]

pecet007 [ - ]

no to ci napisałem... do backreferenc'a 1 wrzuca to co ty chciałeś
nie wiem w czym problem ;)

no tak zaznacza, ale do backreferenca 1 wrzuca tylko to co ty chcesz

© 2000-2024 GRY-OnLine S.A.