A
A
ATauenis2019-08-06 23:30:57
.NET
ATauenis, 2019-08-06 23:30:57

How to remove the edges of a string with a regular expression?

All the best% time of day%. Given a line. For example, the Task to throw out and the end with one regular expression. That is, get the output . Is this possible, and what kind of mask is needed?
eval("document.getElementById('jslink')")
eval("")document.getElementById('jslink')

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stockholm Syndrome, 2019-08-06
@ATauenis

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

K
Kirill Nesmeyanov, 2019-08-07
@SerafimArts

I would suggest a more correct solution than the option from Stockholm Syndrome

eval\s*\(\s*(?|"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')\s*\)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question