B
B
BanterFace2017-08-19 15:09:40
Regular Expressions
BanterFace, 2017-08-19 15:09:40

Is there a regular expression syntax with variables?

I need to replace for example
<img src=\"AAA1\" border=\"0\" alt=\"\"/>
with

<IMG src=\"AAA1\"><s>[img]</s>AAA1<e>[/img]</e></IMG><e>[/url]</e></URL>

, where AAA1 is an arbitrary length URL.
What should I use to do this? 38 million characters are subject to processing.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
4
4iloveg, 2017-08-23
@BanterFace

https://regex101.com/r/bim45f/1

D
Dimonchik, 2017-08-19
@dimonchik2013

in PCRE \1 is usually for the first brackets, \2 for the second, etc.
the number of brackets by the left opening

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question