Thread: Regex examples
View Single Post
Old 10-12-2020, 08:18 PM   #679
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by hobnail View Post
So why did my extra parentheses screw it up?
I think I understand it; the parentheses are telling the or bar what it's working on. It's not like a regular programming language where you could say "boolean a = (b) | (c);"

So I'm guessing I could add some extra parentheses around it and it would still work, but I haven't tested it; Page_(([xvi]+)|(\d+))

And I didn't know that you could use \1 in the same regexp; I thought you could only use it in the replacement part. That's nice to know.

Last edited by hobnail; 10-12-2020 at 08:21 PM.
hobnail is offline   Reply With Quote