Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
getting text inside of parenthesis
#1
i am trying to get the text in of () just not having any luck
i ned to do 2 things
#1 get the text inside ex str a="(the text i want)"
#2 if str is this str a= " some text(more text)"--remove this(more text)-- so there is only first part
#2

I'm somewhat confused by the explanation but you should be able to do it with from?


Macro ( Macro33 )
Code:
Copy      Help
str s="hello"
str ss.from(s)
out ss


No clue if this is what your wanting?
Taking on Quick Macros one day at a time
#3
ok some like this
str a="test text1 (test text2)"
in 1 case i want 2 get only text text2
in the other i only want 2 get text test 1
#4

Like this?


Macro ( Macro33 )
Code:
Copy      Help
lpstr s="Test Text 1 (Test Text 2)"
str q.left(s 11);;Grabs Test Text 1
str w.get(s 13 11);;Grabs Test Text 2

out q
out w
Taking on Quick Macros one day at a time
#5
now those are just samples the text will be different each time and unknown
#6

So did that help or are you still looking for help? Where is the text coming from? Is there going to be one set of text in parentheses and one regular?
Taking on Quick Macros one day at a time
#7
now those are just samples the text will be different each time and unknown meaing the nuber of charcters could be different each time basically i'm getting the text off a window and don't know exactly what the text will be or how many characters are in it till the function is run.also the text may have other characters such as -,:;*or () before the (test text2) that help you out any? the example u gave works fine for the example i gave but the problem is the number of characters and the text will be different everytime
#8

So your saying that there is going to be a random amount of text before the () and there will be a random amount of text inside of the ()? Will there be () inside the string? or are you just using that to seperate the 2 parts?
Taking on Quick Macros one day at a time
#9
yes
radom amount of text here (radom amount of Text here)
text could be like Smile)*ihiry_rgfdg_rryte*Smile) (testing_1234)
#10
Gin i tried using other functions was asking for help making a regular expression to accomplish the task but having trouble. i tried using trim,rtrim, ltrim but that doesn't seem to work


Forum Jump:


Users browsing this thread: 1 Guest(s)