i just want to match this string with regex: How can i do this?
/profil
i try do this in this way:
.*/profil.*
But my software dont match any results in text.
All you need is this
@"(\/profil)"
if all you need is to match "/profil"
then there is no need for the ".*"
Remember the expressions are greedy .
The .
matches any character, and *
tells it that this .
can go on forever. So this expression will eat up all of your input, leaving nothing for the /profil
part.
It seems like you're trying to put a wildcard around /profil
. This is not needed with regular expressions. You should just be able to use /profil
as the full expression and match your string.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.