Usando expresiones regulares con el Source Editor

29 views
Skip to first unread message

Andrés de la Paz

unread,
Jun 7, 2014, 3:21:03 PM6/7/14
to google-chrome-...@googlegroups.com
Chrome versión 35.0.1916.114 m

Con el Editor de Código no sé cómo reemplazar texto usando expresiones regulares y con capturas. Por ejemplo, un patrón como
/>([^<]+)</h4>/
para reemplazar con 
><span>$1</span></h4>
me reemplaza $1 de forma literal y no con la captura de los paréntesis. He intentado \1 y escapar \$1 y no hay manera.

Se agradecería cualquier ayuda.




Andrés de la Paz

unread,
Jun 8, 2014, 3:51:59 AM6/8/14
to google-chrome-...@googlegroups.com
The text search of source editor works with regular expressions. In this screenshot you can see this, but replacing with captures and $ doesn't work.

Alexander Pavlov

unread,
Jun 8, 2014, 6:20:53 AM6/8/14
to Google Chrome Developer Tools
Yeah, the regex-based text replacement is not supported (you can only replace the entire match, not particular groups).



--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/2222ec20-099f-434c-9ab3-2a9a782d6c5f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
-alexander

Andrés de la Paz

unread,
Jun 8, 2014, 6:25:37 AM6/8/14
to google-chrome-...@googlegroups.com
A lot of thanks Alexander, I hope this will be fixed because I'm using this code editor for all my development.


--
You received this message because you are subscribed to a topic in the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-chrome-developer-tools/fgTTzbBY_po/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/CAGg1j-DDKUPYnsyhKohs9ovUSy9aTbrmysxiY4v_jNJqJQ968g%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages