I am using ##\\b\\S+?\\b##
regex to find word starting and ending with ## which finds the below,
##YourFriend##
This does not work when there is a space in between words like
##Your Friend##
I need a regex which works for both the cases, that could find both,
##YourFriend##
##Your Friend##
I tried using \\s
which is used to find the white spaces, but it does not work.
You can use this: ##.*?##
.
Which will match the two ##s in a non greedy way.
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.