Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

regex

28 views
Skip to first unread message

César Lozada

unread,
May 10, 2012, 11:37:10 PM5/10/12
to
Hi,

What's the right expression to find exponent and argument in:
sin<sup>2</sup>(B/2 - C/2) ?

I need to change it to: sin(B/2 - C/2)^2

I've tried with "(sin|cos|tan|cot|sec|csc)<sup>(\d)+</sup>\(*\)" but
this string is not compiled with Wild2RegEx()

Also, I tried with "(sin|cos|tan|cot|sec|csc)<sup>(\d)+</sup>(*)".
This is compiled by with Wild2RegEx() but element in HB_RegExAll()
loses the right ")"

Thanks a lot in advance
Cesar Lozada

ella....@xharbour.com

unread,
May 11, 2012, 5:25:05 AM5/11/12
to

>
> What's the right expression to find exponent and argument in:
> sin<sup>2</sup>(B/2 - C/2) ?
>
> I need to change it to: sin(B/2 - C/2)^2
>

> I tried with "(sin|cos|tan|cot|sec|csc)<sup>(\d)+</sup>(*)"

Please remember that ( and ) and * symbols are meta-characters, and need to be escaped.

Additionally the * symbol IS NOT have the meaning "whatever" string.

Please think about this:
- include your variable expressions in SPAN tags (or other similar) and use a CLASS or ID attribute for that tag, in order to identify it
- when you want to change the SPAN's content, just extract the data string, and pass in another data string

Best regards.


Ella
0 new messages