Add explanations in regexp

Hi people,

I'm wandering about if there is anyway to add comments and explanation into actions and actions groups, to explain what the expression do (each line), this way it becomes easy to understand in posterior views. As I'm beginning with the regexp, this would help a lot...

Thanks

Yes, use (?#) to sit beside the regexp with the comment between the # and ). See attached it working for :mt_ttt: and the same can be said for using it in the replace with regular expressions action.

Example:

$regexp(%title%,'(?#findspaces)\s+',) Screenshots:






Is it important, in which position this sequence is put? Or the position has no effect on the functionality of the regexp ?

I'd love to be able to add comments to action groups. I'd never consider adding one within a regex, as it would only add confusion.

As long as it doesn't break the functionality of the regexp it's fine. It makes sence to put the comment before the regexp. So an example for matching dates in the format YYYY-MM-DD your regexp would look something like this.

Begin Action Group _Script Test#TEST

Action #1 Actiontype 5: Format value Field ______: YEAR Formatstring: $regexp(%date%,'(?#DATE Format YYYY-MM-DD to YEAR in YYYY)(\d{4})-\d{2}-\d{2}','$1')

End Action Group _Script Test#TEST (1 Action)

Before:
DATE: 1999-10-12

After:
DATE: 1999-10-12
YEAR: 1999

Perfect. Thank you stevehero... :wink:

+1 by giving each action within a group a title or description would be great.

As a workaround ... it should be possible to insert a dummy action at any step into a sequence of actions.

Action: Format value
Field: DUMMY
Format string: 'This is my comment to the following action ...'

DD.20121027.1144.CEST

You can insert one or more comments into a regular expression ...
http://www.regular-expressions.info/comments.html
DD.20121027.1146.CEST

http://www.regular-expressions.info/freesp...l#parenscomment

DD.20140918.2000.CEST

Mr. DUMMY, is a very important person, fits wherever he is needed... :smiley: :smiley: :smiley:

Nice ideas DetlevD, Thank you...