Announcement

Collapse
No announcement yet.

3.0.10 replacement item and tagged text

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • hartungr
    replied
    I was thinking of the right side of a perl re substitution, where $1 can be written as ${1} to disambiguate.

    # perl -e '$t="current tag=3I"; $t =~ s/.*?(=| )3I/${1}3J/; print $t . "\n"'
    =3J

    Leave a comment:


  • Erik
    replied
    What do you expect "${1}" to do? I'm unable to find any documentation that mentions special behavior for it ($ means match end of line, {1} means match the previous patter exactly once). We use a third-party perl-compatible regular expression library.

    Leave a comment:


  • hartungr
    replied
    thanks, Erik - makes sense, and works.

    Any chance that ${1} could be supported?

    Leave a comment:


  • Erik
    replied
    Your "Replace with:" should be "$1\3J" (instead of "$13J"). You need the "\" because otherwise the expression tries to use the 13th tagged expression, which doesn't exist.

    Leave a comment:


  • hartungr
    started a topic 3.0.10 replacement item and tagged text

    3.0.10 replacement item and tagged text

    Win XP SP3. Using $1 in "replace with" field ends matching.

    Left file:
    tag is 3I
    using tag=3I

    Right file:
    tag is 3J
    using tag=3J

    I wanted a single text replacement to look for "(=| )3I" (left side) and replace it with "<matching char>3J"
    so that "=3I" would equate to "=3J" and " 3I" equates to " 3J"

    The RE expression on left is correct and matching occurs, as long as I am explicit on the right. When I add the $1 on the right, it no longer matches.

    Thanks
Working...
X