Search for a Word Occuring After A Non-Alphanumeric SymbolHow to remove non-alphanumeric characters?How to use '-prune' option of 'find' in sh?How do I remove all non alphanumeric characters from a string except dash?Simple regex for matching up to an optional character?How to search for word in text file and print part of line with Python?Regular Expression to Validate Plate NumberRegex - search for 2 words in a stringHow to do CamelCase split in python__pycache__ folder executes each time i run any other file in the folderRegular Expression Testing

Why can't we do three-way comparison in C++?

Why are ambiguous grammars bad?

Professor Roman loves to teach unorthodox Chemistry

How to Convert an Object into Array in magento 2

Can a Warforged suffer from magical exhaustion?

Was self-modifying code possible using BASIC?

Etymology of the expression "to entertain an idea"

If the pressure inside and outside a balloon balance, then why does air leave when it pops?

Traceroute showing inter-vlan routing?

How to show a "node near coord" even when it is out of bounds (with clip = true)?

How do I avoid typing "git" at the begining of every Git command?

Parsing text written the millitext font

How can powerful telekinesis avoid violating Newton's 3rd Law?

How does AFV select the winning videos?

What to bootstrap for hypothesis testing

What does the homotopy coherent nerve do to spaces of enriched functors?

Make Gimbap cutter

In American Politics, why is the Justice Department under the President?

Print "N NE E SE S SW W NW"

What exactly "triggers an additional time" in the interaction between Afterlife and Teysa Karlov?

Does a single fopen introduce TOCTOU vulnerability?

How (un)safe is it to ride barefoot?

one-hot-encoding categorical data gives error

What does this line mean in Zelazny's "The Courts of Chaos"?



Search for a Word Occuring After A Non-Alphanumeric Symbol


How to remove non-alphanumeric characters?How to use '-prune' option of 'find' in sh?How do I remove all non alphanumeric characters from a string except dash?Simple regex for matching up to an optional character?How to search for word in text file and print part of line with Python?Regular Expression to Validate Plate NumberRegex - search for 2 words in a stringHow to do CamelCase split in python__pycache__ folder executes each time i run any other file in the folderRegular Expression Testing






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








-1















So I would like to re-implement todo.txt in python as a learning project. Now, I would like (for testing) that if I would add say Ask a Question on SO +StackOverFlow, I would like to reprint +StackOverflow (NOT Ask a Question on SO +StackOverflow, since Regular Expressions are the hard part, the rest is cream cheese (the rest of the owl).



I have tried to use W for this, but all Python gives me is [].



import re
todo = input("")
plusregex = re.findall("W +", todo)
print(plusregex)


Thank you for everything SO community!










share|improve this question






















  • You should either use lookbehind or capture groups (which are more flexible).

    – Mateen Ulhaq
    Mar 24 at 22:55











  • If you are trying to extract the "tags" maybe the regular expression +[^s]+ would help? (A literal plus followed by anything but whitespace repeating)

    – Jebby
    Mar 24 at 23:01











  • re.findall(r"w+", todo)?

    – Wiktor Stribiżew
    Mar 24 at 23:15

















-1















So I would like to re-implement todo.txt in python as a learning project. Now, I would like (for testing) that if I would add say Ask a Question on SO +StackOverFlow, I would like to reprint +StackOverflow (NOT Ask a Question on SO +StackOverflow, since Regular Expressions are the hard part, the rest is cream cheese (the rest of the owl).



I have tried to use W for this, but all Python gives me is [].



import re
todo = input("")
plusregex = re.findall("W +", todo)
print(plusregex)


Thank you for everything SO community!










share|improve this question






















  • You should either use lookbehind or capture groups (which are more flexible).

    – Mateen Ulhaq
    Mar 24 at 22:55











  • If you are trying to extract the "tags" maybe the regular expression +[^s]+ would help? (A literal plus followed by anything but whitespace repeating)

    – Jebby
    Mar 24 at 23:01











  • re.findall(r"w+", todo)?

    – Wiktor Stribiżew
    Mar 24 at 23:15













-1












-1








-1








So I would like to re-implement todo.txt in python as a learning project. Now, I would like (for testing) that if I would add say Ask a Question on SO +StackOverFlow, I would like to reprint +StackOverflow (NOT Ask a Question on SO +StackOverflow, since Regular Expressions are the hard part, the rest is cream cheese (the rest of the owl).



I have tried to use W for this, but all Python gives me is [].



import re
todo = input("")
plusregex = re.findall("W +", todo)
print(plusregex)


Thank you for everything SO community!










share|improve this question














So I would like to re-implement todo.txt in python as a learning project. Now, I would like (for testing) that if I would add say Ask a Question on SO +StackOverFlow, I would like to reprint +StackOverflow (NOT Ask a Question on SO +StackOverflow, since Regular Expressions are the hard part, the rest is cream cheese (the rest of the owl).



I have tried to use W for this, but all Python gives me is [].



import re
todo = input("")
plusregex = re.findall("W +", todo)
print(plusregex)


Thank you for everything SO community!







regex python-3.x






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 24 at 22:51









Ismail AhmedIsmail Ahmed

184




184












  • You should either use lookbehind or capture groups (which are more flexible).

    – Mateen Ulhaq
    Mar 24 at 22:55











  • If you are trying to extract the "tags" maybe the regular expression +[^s]+ would help? (A literal plus followed by anything but whitespace repeating)

    – Jebby
    Mar 24 at 23:01











  • re.findall(r"w+", todo)?

    – Wiktor Stribiżew
    Mar 24 at 23:15

















  • You should either use lookbehind or capture groups (which are more flexible).

    – Mateen Ulhaq
    Mar 24 at 22:55











  • If you are trying to extract the "tags" maybe the regular expression +[^s]+ would help? (A literal plus followed by anything but whitespace repeating)

    – Jebby
    Mar 24 at 23:01











  • re.findall(r"w+", todo)?

    – Wiktor Stribiżew
    Mar 24 at 23:15
















You should either use lookbehind or capture groups (which are more flexible).

– Mateen Ulhaq
Mar 24 at 22:55





You should either use lookbehind or capture groups (which are more flexible).

– Mateen Ulhaq
Mar 24 at 22:55













If you are trying to extract the "tags" maybe the regular expression +[^s]+ would help? (A literal plus followed by anything but whitespace repeating)

– Jebby
Mar 24 at 23:01





If you are trying to extract the "tags" maybe the regular expression +[^s]+ would help? (A literal plus followed by anything but whitespace repeating)

– Jebby
Mar 24 at 23:01













re.findall(r"w+", todo)?

– Wiktor Stribiżew
Mar 24 at 23:15





re.findall(r"w+", todo)?

– Wiktor Stribiżew
Mar 24 at 23:15












1 Answer
1






active

oldest

votes


















0














The regular expression [^ws]w+ would do the trick to capture words starting with non-alphanumeric characters:



import re
todo = "Ask a Question on SO +StackOverFlow +test"
plusregex = re.findall("[^ws]w+", todo)
print(plusregex)


which outputs: ['+StackOverFlow', '@python', '!test']






share|improve this answer























  • Sorry for being late, but it works perfectly!

    – Ismail Ahmed
    Apr 7 at 22:05











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55329347%2fsearch-for-a-word-occuring-after-a-non-alphanumeric-symbol%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














The regular expression [^ws]w+ would do the trick to capture words starting with non-alphanumeric characters:



import re
todo = "Ask a Question on SO +StackOverFlow +test"
plusregex = re.findall("[^ws]w+", todo)
print(plusregex)


which outputs: ['+StackOverFlow', '@python', '!test']






share|improve this answer























  • Sorry for being late, but it works perfectly!

    – Ismail Ahmed
    Apr 7 at 22:05















0














The regular expression [^ws]w+ would do the trick to capture words starting with non-alphanumeric characters:



import re
todo = "Ask a Question on SO +StackOverFlow +test"
plusregex = re.findall("[^ws]w+", todo)
print(plusregex)


which outputs: ['+StackOverFlow', '@python', '!test']






share|improve this answer























  • Sorry for being late, but it works perfectly!

    – Ismail Ahmed
    Apr 7 at 22:05













0












0








0







The regular expression [^ws]w+ would do the trick to capture words starting with non-alphanumeric characters:



import re
todo = "Ask a Question on SO +StackOverFlow +test"
plusregex = re.findall("[^ws]w+", todo)
print(plusregex)


which outputs: ['+StackOverFlow', '@python', '!test']






share|improve this answer













The regular expression [^ws]w+ would do the trick to capture words starting with non-alphanumeric characters:



import re
todo = "Ask a Question on SO +StackOverFlow +test"
plusregex = re.findall("[^ws]w+", todo)
print(plusregex)


which outputs: ['+StackOverFlow', '@python', '!test']







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 25 at 6:13









glhrglhr

3,3131921




3,3131921












  • Sorry for being late, but it works perfectly!

    – Ismail Ahmed
    Apr 7 at 22:05

















  • Sorry for being late, but it works perfectly!

    – Ismail Ahmed
    Apr 7 at 22:05
















Sorry for being late, but it works perfectly!

– Ismail Ahmed
Apr 7 at 22:05





Sorry for being late, but it works perfectly!

– Ismail Ahmed
Apr 7 at 22:05



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55329347%2fsearch-for-a-word-occuring-after-a-non-alphanumeric-symbol%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript