Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript]wyrażenia regulane
query
post 3.09.2014, 08:58:00
Post #1





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 3.09.2014

Ostrzeżenie: (0%)
-----


Witam

Mam fragment
  1. "jakis tekst my_function('arg1,arg2') jakis tekst"

Chcę pobrać wszystkie argumenty funkcji 'my_function' podając tylko jeden argument tej funkcji.


Niestety poniższy kod nie działa a powinien zwrócić wartość 'arg1,arg2'
  1. var string = "jakis tekst my_function('arg1,arg2') jakis tekst";
  2. var regex = /my_function\(\'(arg2)\'\)/;
  3. console.log( string.match(regex));


Ten post edytował query 3.09.2014, 08:59:56
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 16:01