Extracting the return value in Squeak (SmallTalk)
I want to extract the return value from a given text that represent a method. for example: g: x and: y Transcript show: x; show: y. ^x+y. so to solve I used the regular expression: \^\s*(\w+.*). when I run this on some regex websites it seems to work and do what I want, for example : https://regex101.com/ but when I run the following program it seems that squeak return nil to it (can't find a match). I suspect that is because I am using the character ^. but I escaped that character so I have no idea why that is failing to work. the code I used to test it: |aString regexObj | aString := 'g: x and: y Transcript show: x; show: y. ^x+y.'. regexObj := '\^\s*(\w+.*).' asRegex. regexObj matches: aString. returnedType:= (regexObj subexpression:2). Transcript show: returnedType. anyone knows why, and how to solve it? ,Thanks.
Find file paths that have spaces
How to extract all (finite) possible strings from regex?
regular expression for subnet of ip address
Add parameter to URL using .htaccess
Retrieve string between two string delimiters using regex in perl
regex to break all chars between matching criteria
Date format conversion in Perl
Divide cell in excel by 3 different string patterns using vba
Why does a space break validation here?
Parsing numbers in a text using regexp MATLAB
Dmesg command piping it to grep
How to combine two regex's
How to delete string if it contains specific character using regex in perl?
Slash before # when linking with href=“#”
word separated with single space character from bash output
Powershell Get-ADOrganizationalUnit Regex