View Single Post
Old 03-21-2011, 01:30 PM   #23
Faster
Connoisseur
Faster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of light
 
Posts: 61
Karma: 12096
Join Date: Sep 2010
Location: Tasmania
Device: Sony PRS 650
Interesting discussion.
Why use .* instead of .+
Answer: because * looks for zero or more whilst + looks for one or more. If two underlines occurred next to each other they would not be found. Could that occur? Yes, because the italicized word was deleted at some stage but not the tags.

It is worth noting that MS Word has an option to change the underline bracketed text to italic. Go to Format - AutoFormat - Options, or go to Tools - AutoCorrect Options - AutoFormat As You Type. It also deals with *words here* changed to bold.

Concerning back referencing, you can also use a back reference in the Find box:
Code:
_(.*)_
could be written as:
Code:
(_)(.*)\1
and the Replace expression would be:
Code:
\2
As for flavours of Regex - couldn't agree more about the confusion it causes. The worst aspect to me is the limitations as to what can be used in the Replace box.
Faster is offline   Reply With Quote