S
S
Svyatoslav Khusamov2015-11-01 19:30:53
Regular Expressions
Svyatoslav Khusamov, 2015-11-01 19:30:53

How to find all occurrences of a search word using a regular expression?

My regex and example text https://regex101.com/r/yL0jL5/1
Why does it only find the first occurrence of the word Ludovic?
How can I make sure that the next ones are also found?
I need to find all the Ludovics after the bars.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Here's roughly what you need to get: https:// regex101.com/r/xT5gR2/1
But you need to find all the Ludovics after the bars.
Moreover, their number is not known in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
ShamblerR, 2015-11-02
@khusamov

#.*?(Людовик)[X|V|I|L]{1,}, *?(Людовик)[X|V|I|L]{1,}, *?(Людовик)[X|V|I|L]{1,}, *?(Людовик)[X|V|I|L]{1,}, *?(Людовик)[X|V|I|L]{1,}

IT IS ACTUALLY ALWAYS REPEATING *?(Ludovik)[X|V|I|L]{1,}, EXCEPT THE FIRST AND LAST, THERE ARE A PAIR OF CHARACTERS ON THE EDGE.
Is it necessary?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question