Answer the question
In order to leave comments, you need to log in
How to write a regular expression with a condition?
The following strings are possible:
#name
#name#
name# You
need to find characters #
only if:
- either it comes at the end
- or it goes both at the beginning and at the end at the same time.
In other words: if there is a character #
at the end, then you need to select all the characters #
in the string.
Tried through a condition, but it doesn't work: if it's at the end #
- then select everything for me #
(#)$(?(1)#)
. How can I compose such a regular expression?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question