Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in R Programming by (50.2k points)

From the subsequent text, I just want mn12 but I am not getting it. With the first code, I am getting mn12 as well as mn14. I just need mn12.

Text:please change the following with something. mn12 * operation 0010 to be mn14-f10

'\\b(m|s|x|p)(n|s|t)[[:alnum:]]{2}\\b')

'\\b(m|s|x|p)(n|s|t)[[:alnum:]]{2}[^-]\\b')

Please guide me where I am going wrong.

1 Answer

0 votes
by (108k points)

The [[:alnum:]]{2} doesn't anticipate "any digit followed by 2". It means "any sequence of two digits".

If you're looking to capture mn12 but not mn14, you can use the following code in R programming:

'\\b(m|s|x|p)(n|s|t)[[:alnum:]]2\\b'

Related questions

0 votes
1 answer
0 votes
1 answer

Browse Categories

...