Hi ,
Can we use lookahead and lookbehind at same time in regex.
“My Performance appraisal cycle goal”
I need find 1 word present “appraisal” and 1 word after “appraisal”.
Regards,
Sushant
Hi ,
Can we use lookahead and lookbehind at same time in regex.
“My Performance appraisal cycle goal”
I need find 1 word present “appraisal” and 1 word after “appraisal”.
Regards,
Sushant
Hi @lakshman,
It works for me thanks.
Can you pls let me know if i want to convert output of regex(“ienumerable”) into string then what is the way to do that.
Because i need to check specific word present in regex output or not using if condition
Regards,
Susahnt
Use this:
System.Text.RegularExpression.Regex.Matches(“your input string”,(?>\w+){1}(?>\sappraisal)(?>\s\w+){1})(0).Tostring
Hi @lakshman,
what is the use of this
Regards,
Susahnt
Here, I used Matches Method. It will find all matched values in the given string and will give output as collection of match values.
matchValue(0).Tostring - will give First match
matchValue(1).Tostring - will give Second match
Etc…
Try below one in IF condition.
matchValue(0).Tostring.Contains(“Required word”)
Then “word found”
Else “word not found”
Hi @lakshman,
It works.
One last help, how to check if the given regex output ienumerable contains any number or not ?
“hello 1234 s1s sushant” this is the output of regex.
so I need to check whether this output contains any number in between chararcters or words.
How to check that
Regards,
Sushant
Again use regular expression to check whether String contains any number of not.
System.Text.RegularExpression.Regex.IsMatche(inputString, [0-9])
It will give Boolean value as output. If it is true then input String contains numbers else not.
Hi @lakshman
I am facing issue in regex.
If yoy see the last line in Test string it is also having “By” word but its not highlighting word which are present before and after that.
Can you help me. I guess because of . its creating problem
I need such regex which can accept anyvalue (number,word,special character) after and before “by”
Hi @lakshman,
Could you pls help me out on above issue
First replace dot . with nothing and then apply regular expression to fetch required data.
yourString = yourString.Replace(“.”,“”)
Hi @lakshman,
Actually i need to use this regex on pdf which containing price. In this case if i replace . by “” then price of actual product will get change.
Is it possible to do something in regex which u shared earlier.
Because this issue was happening for all special character not only for .
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.