Entering edit mode
9.0 years ago
M K
▴
660
Help with understanding the expressions in the following gsub
function
("-__-|\\+__\\+","+",x)
Help with understanding the expressions in the following gsub
function
("-__-|\\+__\\+","+",x)
This https://regex101.com/ could be also a better place to check and to learn, as it explain every part of the regular expression
("-__-|\\+__\\+","+",x)/
("-__-|\\+__\\+","+",x)
"-__-
"-__-
matches the characters "-__-
literally\\+__\\+","+",x
",x
matches the characters ",x
literally (case sensitive)"+
matches the characters "
literally
",
matches the characters ",
literally\\+
matches the character \
literally
+
Between one and unlimited times, as many times as possible, giving back as needed [greedy]__
matches the characters __
literally\\+
matches the character \
literally
+
Between one and unlimited times, as many times as possible, giving back as needed [greedy]MATCH INFORMATION
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
It seems you deleted your questions text. You should not do that, as now other people with the same question as yours will not find the answers from which you benefited, and also makes a mess on this forum.
I didn't delete my question. Maybe when I sent my reply I put it in the same question box that's why the question is deleted. I will post the question again.
Use comments to reply, edit your question just to correct mistakes or provide additional information if needed. Thanks for reposting the question.
http://perldoc.perl.org/perlre.html#Regular-Expressions I'd suggest looking at some regex guides. The question is not appropriate for this forum, I'd suggest you try StackOverflow for future general cs queries.