Skip to main content
Question

backreference in regexp

  • October 25, 2019
  • 2 replies
  • 22 views

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • 2252 replies

Hi All,

 

Does anyone know this issue?

 

[regexp {^(?!(,)\\1+)(?!(\\d)\\2+)[0-9,]+$} {@Value(_attr_value)}]

and with a simpler regexp

(?!(,)\\1+)[0-9,]

 

As you can see it uses back references. ( the \\1 and \\2)

Both raise an error when used in a attribute creator. Error says "invalid back reference" number is used. Which is not true.

I suspect that the negative back reference handling causes this?

 

But..

The same regexp works if I use a string searcher. It does what I intended (and matches Rubular behavior) and does not complain about faulty back reference numbers.

 

Is the [regexp .. .. ] flawed?

 

 

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • October 25, 2019

I know at one time regex was implemented slightly differently depending on where it was being used. But I thought it had all been standardised now


gio
Contributor
Forum|alt.badge.img+15
  • Author
  • Contributor
  • 2252 replies
  • October 25, 2019

@ebygomm

Did you try creating a scripted parameter where u would like to output a string with a space (or more spaces)?

 

In tcl scripted parameter this fails all over..until you decide to not use a space character or shorthand for space (\\s). Only works when u use the Unicode \\U040.

 

Though much improved, there seem to still be remnants of days past.

 

So in parameter, in tcl regexp, regexp in stringsearcher ...all differ somewhere still.

But again, used to be much worse..:)