W
W
wartur2012-01-15 23:25:13
PHP
wartur, 2012-01-15 23:25:13

Express yourself regularly?

Hello, dear habrausers who can express themselves regularly.
I myself am more or less familiar with this language, but that's just not very successful, and time is running out.
I have an initial pattern, which I managed to compose.
\{([^}]+)\}<br/>
It can parse the following text:

Текст текст {это я найду} Текст текст, который я разделю {это я тоже найду} текст текст который я тоже разделю<br/>

As a result of my manipulations, I get 2 arrays, one with highlighted (without brackets) “I will find this”, and the second array with texts “Text text”.
In general, why empty talk, here is the result
I really want the following text to be parsed
Текст текст /*это я найду*/ Текст текст /*это я тоже найду*/ текст текст<br/>

Therefore, he regularly cursed like this:
/\*([^/\*]+)/\*<br/>
They obviously didn’t understand me, and nothing was parsed for me, it turned out the same as it was.
Please help me write the correct pattern, I will be very, very grateful, because you will save an incredibly lot of time, I have always had a hard time with regular expressions, although I read the article “learning to express regularly” =(
If it’s interesting , then I’m fighting on my own here . I’m sure that sooner or later I will answer my own question, but I would like it to be earlier.Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
max_mara, 2012-01-15
@wartur

It seems to be so?
#(\/\*.*?\*\/)#

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question