c# - String Manipulation with regular expression -


i have seen in forum, many of people doing string manipulation using regular expression. there performance benefit on regex rather normal indexing manipulation?

it helpful, if explain how or provide link explaining it.

it's not performance thing; people use regular expressions because easy-to-use yet ultra-flexible tool sorts of string manipulations. once master syntax, regular expressions allow express quite complex string manipulations, , since regular expression string, can store regular expressions in variables, files, databases, , bunch of other things.

consider simple regex: /\ba[a-z]*\b/, finds whole words start capital 'a', followed lowercase letters (e.g., running on "and good" yield ["and", "all"]). write function same (in language of choice) using standard string manipulations. you'll see advantages of regular expressions.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -